mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
auth: Set valid_attestation more unconditionally in social auth.
This commit is contained in:
@@ -431,7 +431,7 @@ class GitHubAuthBackendTest(ZulipTestCase):
|
|||||||
|
|
||||||
kwargs = {'realm': get_realm('zulip'),
|
kwargs = {'realm': get_realm('zulip'),
|
||||||
'response': response,
|
'response': response,
|
||||||
'return_data': {}}
|
'return_data': {'valid_attestation': True}}
|
||||||
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
|
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
|
||||||
|
|
||||||
def test_github_backend_do_auth_for_default_auth_failed(self):
|
def test_github_backend_do_auth_for_default_auth_failed(self):
|
||||||
@@ -461,7 +461,7 @@ class GitHubAuthBackendTest(ZulipTestCase):
|
|||||||
|
|
||||||
kwargs = {'realm': get_realm('zulip'),
|
kwargs = {'realm': get_realm('zulip'),
|
||||||
'response': response,
|
'response': response,
|
||||||
'return_data': {}}
|
'return_data': {'valid_attestation': True}}
|
||||||
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
|
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
|
||||||
|
|
||||||
def test_github_backend_do_auth_for_team_auth_failed(self):
|
def test_github_backend_do_auth_for_team_auth_failed(self):
|
||||||
@@ -491,7 +491,7 @@ class GitHubAuthBackendTest(ZulipTestCase):
|
|||||||
|
|
||||||
kwargs = {'realm': get_realm('zulip'),
|
kwargs = {'realm': get_realm('zulip'),
|
||||||
'response': response,
|
'response': response,
|
||||||
'return_data': {}}
|
'return_data': {'valid_attestation': True}}
|
||||||
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
|
result.assert_called_with(self.user_profile, 'fake-access-token', **kwargs)
|
||||||
|
|
||||||
def test_github_backend_do_auth_for_org_auth_failed(self):
|
def test_github_backend_do_auth_for_org_auth_failed(self):
|
||||||
|
|||||||
@@ -206,8 +206,8 @@ class SocialAuthMixin(ZulipAuthMixin):
|
|||||||
try:
|
try:
|
||||||
user_profile = get_user_profile_by_email(email_address)
|
user_profile = get_user_profile_by_email(email_address)
|
||||||
except UserProfile.DoesNotExist:
|
except UserProfile.DoesNotExist:
|
||||||
return_data["valid_attestation"] = True
|
|
||||||
return None
|
return None
|
||||||
|
return_data["valid_attestation"] = True
|
||||||
|
|
||||||
if not user_profile.is_active:
|
if not user_profile.is_active:
|
||||||
return_data["inactive_user"] = True
|
return_data["inactive_user"] = True
|
||||||
|
|||||||
Reference in New Issue
Block a user