Adds never_cache decorator to TOTP and Email start and auth views to prevent browser from caching previous codes.

This commit is contained in:
nswain
2020-08-26 11:06:31 -06:00
parent 3d37d0a51f
commit 55375f7002
2 changed files with 6 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
from django.shortcuts import render
from django.views.decorators.cache import never_cache
from django.http import HttpResponse
from .models import *
from django.template.context_processors import csrf
@@ -31,6 +32,7 @@ def recheck(request):
return HttpResponse(simplejson.dumps({"recheck": False}), content_type="application/json")
return render(request,"TOTP/recheck.html", context)
@never_cache
def auth(request):
context=csrf(request)
if request.method=="POST":
@@ -68,5 +70,6 @@ def verify(request):
return HttpResponse("Success")
else: return HttpResponse("Error")
@never_cache
def start(request):
return render(request,"TOTP/Add.html",{})