mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
auth: Remove dead invalid_subdomain code path.
This code path has actually been dead for a while (since `invalid_subdomain` gets set to True only when `user_profile` is `None`). We might want to re-introduce it later, but for now, we eliminate it and the artificial test that provided it with test coverage.
This commit is contained in:
@@ -2260,20 +2260,6 @@ class LoginEmailValidatorTestCase(ZulipTestCase):
|
||||
with self.assertRaises(JsonableError):
|
||||
validate_login_email(u'hamlet')
|
||||
|
||||
class LoginOrRegisterRemoteUserTestCase(ZulipTestCase):
|
||||
def test_invalid_subdomain(self) -> None:
|
||||
full_name = 'Hamlet'
|
||||
invalid_subdomain = True
|
||||
user_profile = self.example_user('hamlet')
|
||||
request = POSTRequestMock({}, user_profile)
|
||||
response = login_or_register_remote_user(
|
||||
request,
|
||||
self.example_email('hamlet'),
|
||||
user_profile,
|
||||
full_name=full_name,
|
||||
invalid_subdomain=invalid_subdomain)
|
||||
self.assertIn('/accounts/login/?subdomain=1', response.url)
|
||||
|
||||
class LDAPBackendTest(ZulipTestCase):
|
||||
@override_settings(AUTHENTICATION_BACKENDS=('zproject.backends.ZulipLDAPAuthBackend',))
|
||||
def test_non_existing_realm(self) -> None:
|
||||
|
||||
@@ -153,10 +153,6 @@ def login_or_register_remote_user(request: HttpRequest, remote_username: Optiona
|
||||
'zerver/confirm_continue_registration.html',
|
||||
context=context)
|
||||
|
||||
if invalid_subdomain:
|
||||
# Show login page with an error message
|
||||
return redirect_to_subdomain_login_url()
|
||||
|
||||
if mobile_flow_otp is not None:
|
||||
# For the mobile Oauth flow, we send the API key and other
|
||||
# necessary details in a redirect to a zulip:// URI scheme.
|
||||
|
||||
Reference in New Issue
Block a user