auth: Move check for social backend earlier.

This better fits the flow that we use in other auth backends.
This commit is contained in:
Tim Abbott 2017-11-21 14:50:06 -08:00 committed by Greg Price
parent 665fc594db
commit 22b7de0ccd
1 changed files with 3 additions and 4 deletions

View File

@ -197,6 +197,9 @@ class SocialAuthMixin(ZulipAuthMixin):
realm = kwargs.get("realm")
if realm is None:
return None
if not auth_enabled_helper([self.auth_backend_name], realm):
return_data["auth_backend_disabled"] = True
return None
email_address = self.get_email_address(*args, **kwargs)
if not email_address:
@ -221,10 +224,6 @@ class SocialAuthMixin(ZulipAuthMixin):
return_data["invalid_subdomain"] = True
return None
if not auth_enabled_helper([self.auth_backend_name], realm):
return_data["auth_backend_disabled"] = True
return None
return user_profile
def process_do_auth(self, user_profile, *args, **kwargs):