mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	auth: Convert DevAuthBackend to use a unique argument pattern.
This helps ensure that we won't accidentally activate this backend on other code paths.
This commit is contained in:
		@@ -533,9 +533,10 @@ class ZulipLDAPUserPopulator(ZulipLDAPAuthBackendBase):
 | 
			
		||||
class DevAuthBackend(ZulipAuthMixin):
 | 
			
		||||
    # Allow logging in as any user without a password.
 | 
			
		||||
    # This is used for convenience when developing Zulip.
 | 
			
		||||
    def authenticate(self, username: str, realm_subdomain: Optional[str]=None,
 | 
			
		||||
    def authenticate(self, dev_auth_username: Optional[str]=None, realm_subdomain: Optional[str]=None,
 | 
			
		||||
                     return_data: Optional[Dict[str, Any]]=None) -> Optional[UserProfile]:
 | 
			
		||||
        user_profile = common_get_active_user_by_email(username, return_data=return_data)
 | 
			
		||||
        assert dev_auth_username is not None
 | 
			
		||||
        user_profile = common_get_active_user_by_email(dev_auth_username, return_data=return_data)
 | 
			
		||||
        if user_profile is None:
 | 
			
		||||
            return None
 | 
			
		||||
        if not dev_auth_enabled(user_profile.realm):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user