Skip to content

Commit

Permalink
Fix is_authenticated #13
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalioby committed Jun 18, 2020
1 parent bc407ca commit a820206
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mfa/FIDO2.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ def authenticate_complete(request):
mfa["next_check"] = int((datetime.datetime.now()+ datetime.timedelta(
seconds=random.randint(settings.MFA_RECHECK_MIN, settings.MFA_RECHECK_MAX))).strftime("%s"))
request.session["mfa"] = mfa
if not request.user.is_authenticated():
try:
authenticated=request.user.is_authenticated
except:
authenticated = request.user.is_authenticated()
if not authenticated:
res=login(request)
if not "location" in res: return reset_cookie(request)
return HttpResponse(simplejson.dumps({'status':"OK","redirect":res["location"]}),content_type="application/json")
Expand Down

0 comments on commit a820206

Please sign in to comment.