mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 10:27:37 -02:30
Disallow changing a users password for social auth
This commit is contained in:
@@ -630,6 +630,12 @@ class UserSerializer(BaseSerializer):
|
|||||||
new_password = None
|
new_password = None
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
|
if (getattr(settings, 'SOCIAL_AUTH_GOOGLE_OAUTH2_KEY', None) or
|
||||||
|
getattr(settings, 'SOCIAL_AUTH_GITHUB_KEY', None) or
|
||||||
|
getattr(settings, 'SOCIAL_AUTH_GITHUB_ORG_KEY', None) or
|
||||||
|
getattr(settings, 'SOCIAL_AUTH_GITHUB_TEAM_KEY', None) or
|
||||||
|
getattr(settings, 'SOCIAL_AUTH_SAML_ENABLED_IDPS', None)) and obj.social_auth.all():
|
||||||
|
new_password = None
|
||||||
if new_password:
|
if new_password:
|
||||||
obj.set_password(new_password)
|
obj.set_password(new_password)
|
||||||
if not obj.password:
|
if not obj.password:
|
||||||
|
|||||||
Reference in New Issue
Block a user