Skip to content
Snippets Groups Projects
Commit 6873919a authored by sandeepsajan0's avatar sandeepsajan0
Browse files

Skip the 2fa for users with social auth

parent 5900844d
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class TwoFactorAuthenticationMiddleware:
# code to execute before the view
user = request.user
if settings.ENFORCE_TWO_FACTOR:
if user.is_authenticated and not user.is_verified():
if user.is_authenticated and not user.is_verified() and not user.social_auth.exists():
if not self.is_path_allowed(request.path):
return redirect('/account/two_factor/required/')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment