From a820206a249375892cc9a074b3a5351149b4e36c Mon Sep 17 00:00:00 2001 From: Mohamed ElKalioby Date: Thu, 18 Jun 2020 18:24:16 +0300 Subject: [PATCH] Fix is_authenticated #13 --- mfa/FIDO2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mfa/FIDO2.py b/mfa/FIDO2.py index 5910052..0e6e242 100644 --- a/mfa/FIDO2.py +++ b/mfa/FIDO2.py @@ -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")