mirror of https://github.com/zulip/zulip.git
backend: Add support for mobile_flow_otp in social auth.
It turns out that very little code change is required to support GitHub auth on mobile. Ideally, this would come with tests, though the complicated part of the code path is covered by the Google auth version. But writing a test for this would take a long time, and I think it's worth having the feature now, so I'll be doing tests as a follow-up project.
This commit is contained in:
parent
327db90a3d
commit
63bbbba5aa
|
@ -229,10 +229,12 @@ class SocialAuthMixin(ZulipAuthMixin):
|
|||
is_signup = strategy.session_get('is_signup') == '1'
|
||||
|
||||
subdomain = strategy.session_get('subdomain')
|
||||
if not subdomain:
|
||||
mobile_flow_otp = strategy.session_get('mobile_flow_otp')
|
||||
if not subdomain or mobile_flow_otp is not None:
|
||||
return login_or_register_remote_user(request, email_address,
|
||||
user_profile, full_name,
|
||||
invalid_subdomain=bool(invalid_subdomain),
|
||||
mobile_flow_otp=mobile_flow_otp,
|
||||
is_signup=is_signup)
|
||||
try:
|
||||
realm = Realm.objects.get(string_id=subdomain)
|
||||
|
|
|
@ -1366,7 +1366,7 @@ else:
|
|||
# SOCIAL AUTHENTICATION SETTINGS
|
||||
########################################################################
|
||||
|
||||
SOCIAL_AUTH_FIELDS_STORED_IN_SESSION = ['subdomain', 'is_signup']
|
||||
SOCIAL_AUTH_FIELDS_STORED_IN_SESSION = ['subdomain', 'is_signup', 'mobile_flow_otp']
|
||||
SOCIAL_AUTH_LOGIN_ERROR_URL = '/login/'
|
||||
|
||||
SOCIAL_AUTH_GITHUB_SECRET = get_secret('social_auth_github_secret')
|
||||
|
|
Loading…
Reference in New Issue