Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix not being able to logout while prompted for 2FA. #949

Merged
merged 1 commit into from Apr 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion judge/middleware.py
Expand Up @@ -13,7 +13,8 @@ def __call__(self, request):
profile = request.profile = request.user.profile
login_2fa_path = reverse('login_2fa')
if (profile.is_totp_enabled and not request.session.get('2fa_passed', False) and
request.path != login_2fa_path and not request.path.startswith(settings.STATIC_URL)):
request.path not in (login_2fa_path, reverse('auth_logout')) and
not request.path.startswith(settings.STATIC_URL)):
return HttpResponseRedirect(login_2fa_path + '?next=' + urlquote(request.get_full_path()))
else:
request.profile = None
Expand Down