Fix redirect loop caused when both 2fa and password change are forced (#3787)

This commit is contained in:
Kian Cross
2023-12-29 16:02:23 +01:00
committed by GitHub
parent 3101660a3e
commit fabe476397

View File

@@ -139,7 +139,7 @@ class PermissionMiddleware:
return redirect_to_url(reverse('control:user.settings') + '?next=' + quote(request.get_full_path()))
if not request.user.require_2fa and settings.PRETIX_OBLIGATORY_2FA \
and url_name not in self.EXCEPTIONS_2FA:
and url_name not in self.EXCEPTIONS_2FA and not request.user.needs_password_change:
return redirect_to_url(reverse('control:user.settings.2fa'))
if 'event' in url.kwargs and 'organizer' in url.kwargs: