mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	auth: Fix redirect loop in development environment.
Since the REALMS_HAVE_SUBDOMAINS migration in development, we've had scattered reports of users who found trying to open 127.0.0.1:9991 resulting in a redirect loop between zulipdev.com:9991, zulipdev.com:9991/devlogin, and zulipdev.com:9991/devlogin/, and back to zulipdev.com:9991. We fix this temporarily through a small cleanup, which is to have that last step in the loop send the user to the subdomain where they're actually logged in, zulip.zulipdev.com:9991. There's more to be done before this system will make sense, though.
This commit is contained in:
		@@ -485,7 +485,7 @@ def redirect_to_misconfigured_ldap_notice(error_type):
 | 
				
			|||||||
def login_page(request, **kwargs):
 | 
					def login_page(request, **kwargs):
 | 
				
			||||||
    # type: (HttpRequest, **Any) -> HttpResponse
 | 
					    # type: (HttpRequest, **Any) -> HttpResponse
 | 
				
			||||||
    if request.user.is_authenticated:
 | 
					    if request.user.is_authenticated:
 | 
				
			||||||
        return HttpResponseRedirect("/")
 | 
					        return HttpResponseRedirect(request.user.realm.uri)
 | 
				
			||||||
    if is_subdomain_root_or_alias(request) and settings.ROOT_DOMAIN_LANDING_PAGE:
 | 
					    if is_subdomain_root_or_alias(request) and settings.ROOT_DOMAIN_LANDING_PAGE:
 | 
				
			||||||
        redirect_url = reverse('zerver.views.registration.find_account')
 | 
					        redirect_url = reverse('zerver.views.registration.find_account')
 | 
				
			||||||
        return HttpResponseRedirect(redirect_url)
 | 
					        return HttpResponseRedirect(redirect_url)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user