mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
auth: Remove unnecessary remote_user=None code path.
This code path was only required because we had remote_user set as a positional argument here, and thus we'd be running this auth backend's code when actually using another auth backend (due to how Django auth backends are selected based on argument signature).
This commit is contained in:
@@ -1626,11 +1626,6 @@ class TestZulipRemoteUserBackend(ZulipTestCase):
|
||||
self.assertEqual(result.status_code, 302)
|
||||
self.assertEqual(get_session_dict_user(self.client.session), user_profile.id)
|
||||
|
||||
def test_authenticate_with_missing_user(self):
|
||||
# type: () -> None
|
||||
backend = ZulipRemoteUserBackend()
|
||||
self.assertIs(backend.authenticate(None), None)
|
||||
|
||||
def test_login_success_with_sso_append_domain(self):
|
||||
# type: () -> None
|
||||
username = 'hamlet'
|
||||
|
||||
@@ -412,10 +412,9 @@ class ZulipRemoteUserBackend(RemoteUserBackend):
|
||||
|
||||
def authenticate(self, remote_user: Optional[str],
|
||||
realm: Optional[Realm]=None) -> Optional[UserProfile]:
|
||||
assert remote_user is not None
|
||||
if realm is None:
|
||||
return None
|
||||
if remote_user is None:
|
||||
return None
|
||||
|
||||
email = remote_user_to_email(remote_user)
|
||||
user_profile = common_get_active_user_by_email(email)
|
||||
|
||||
Reference in New Issue
Block a user