diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py index d861f68a63..43d5dfed21 100644 --- a/zerver/tests/test_auth_backends.py +++ b/zerver/tests/test_auth_backends.py @@ -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: diff --git a/zerver/views/auth.py b/zerver/views/auth.py index 736c291ffe..5dde7d14a5 100644 --- a/zerver/views/auth.py +++ b/zerver/views/auth.py @@ -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.