Merge pull request #35424 from akhilnarang/oauth-fix-mixed-case-email

fix(oauth): convert email to lowercase
This commit is contained in:
Akhil Narang 2025-12-29 16:24:31 +05:30 committed by GitHub
commit 344d8cbead
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -213,7 +213,9 @@ def login_oauth_user(
frappe.respond_as_web_page(_("Invalid Request"), _("Token is missing"), http_status_code=417)
return
user = get_email(data)
# All user emails are stored as lowercase, but OAuth provider could have it in mixed case.
# We pass the email as-is to LoginManager, which could result in a session with an incorrect email.
user = get_email(data).lower()
if not user:
frappe.respond_as_web_page(