Allow OAuth 2 login using the username claim if the email is absent from the user profile. #8652

This commit is contained in:
Yogesh Mahajan
2025-04-23 15:21:25 +05:30
committed by GitHub
parent ec3d142ad9
commit 75dc42cf24
-5
View File
@@ -166,11 +166,6 @@ class OAuth2Authentication(BaseAuthentication):
]
email = profile_dict[email_key[0]] if (len(email_key) > 0) else None
if not email:
error_msg = "No email found in profile data."
current_app.logger.exception(error_msg)
return False, gettext(error_msg)
username = email
username_claim = None
if 'OAUTH2_USERNAME_CLAIM' in self.oauth2_config[