mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 09:27:43 +00:00
auth: Check for RemoteUserBackend being enabled earlier.
This is possible now that we have a realm object before fetching the UserProfile object.
This commit is contained in:
@@ -415,6 +415,8 @@ class ZulipRemoteUserBackend(RemoteUserBackend):
|
|||||||
assert remote_user is not None
|
assert remote_user is not None
|
||||||
if realm is None:
|
if realm is None:
|
||||||
return None
|
return None
|
||||||
|
if not auth_enabled_helper(["RemoteUser"], realm):
|
||||||
|
return None
|
||||||
|
|
||||||
email = remote_user_to_email(remote_user)
|
email = remote_user_to_email(remote_user)
|
||||||
user_profile = common_get_active_user_by_email(email)
|
user_profile = common_get_active_user_by_email(email)
|
||||||
@@ -422,8 +424,6 @@ class ZulipRemoteUserBackend(RemoteUserBackend):
|
|||||||
return None
|
return None
|
||||||
if not user_matches_subdomain(realm.subdomain, user_profile):
|
if not user_matches_subdomain(realm.subdomain, user_profile):
|
||||||
return None
|
return None
|
||||||
if not auth_enabled_helper(["RemoteUser"], user_profile.realm):
|
|
||||||
return None
|
|
||||||
return user_profile
|
return user_profile
|
||||||
|
|
||||||
class ZulipLDAPException(_LDAPUser.AuthenticationFailed):
|
class ZulipLDAPException(_LDAPUser.AuthenticationFailed):
|
||||||
|
|||||||
Reference in New Issue
Block a user