mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
auth: Convert GoogleMobileOauth2Backend to use new helper.
That logic was now just duplicate code.
This commit is contained in:
@@ -396,21 +396,7 @@ class GoogleMobileOauth2Backend(ZulipAuthMixin):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
return_data["valid_attestation"] = True
|
return_data["valid_attestation"] = True
|
||||||
|
return common_get_active_user(token_payload["email"], realm, return_data)
|
||||||
try:
|
|
||||||
user_profile = get_user_profile_by_email(token_payload["email"])
|
|
||||||
except UserProfile.DoesNotExist:
|
|
||||||
return None
|
|
||||||
if not user_profile.is_active:
|
|
||||||
return_data["inactive_user"] = True
|
|
||||||
return None
|
|
||||||
if user_profile.realm.deactivated:
|
|
||||||
return_data["inactive_realm"] = True
|
|
||||||
return None
|
|
||||||
if not user_matches_subdomain(realm.subdomain, user_profile):
|
|
||||||
return_data["invalid_subdomain"] = True
|
|
||||||
return None
|
|
||||||
return user_profile
|
|
||||||
|
|
||||||
class ZulipRemoteUserBackend(RemoteUserBackend):
|
class ZulipRemoteUserBackend(RemoteUserBackend):
|
||||||
create_unknown_user = False
|
create_unknown_user = False
|
||||||
|
|||||||
Reference in New Issue
Block a user