(backend) handle inactive user

Handle case where user is inactive.
Previously this edge case would cause unexpected behavior.

Related to previous commit that added the test coverage.
This commit is contained in:
lebaudantoine
2024-11-04 10:52:38 +01:00
committed by aleb_the_flash
parent eeb71f90bc
commit 04d76acce5

View File

@@ -83,4 +83,10 @@ class OIDCAuthenticationBackend(MozillaOIDCAuthenticationBackend):
else:
user = None
if not user:
return None
if not user.is_active:
raise SuspiciousOperation(_("User account is disabled"))
return user