diff --git a/hypha/apply/users/middleware.py b/hypha/apply/users/middleware.py index b466c1d49bd6d96ec3064568aa358cd9cf29030b..53ae4fc4f3bc1363d4a7d528459805271e69e43d 100644 --- a/hypha/apply/users/middleware.py +++ b/hypha/apply/users/middleware.py @@ -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/')