mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	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:
		@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user