mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Emails are case insensitive
This commit is contained in:
parent
0c8025d513
commit
01a68f8cc7
18 changed files with 105 additions and 13 deletions
|
@ -20,7 +20,7 @@ class Auth::FacebookAuthenticator < Auth::Authenticator
|
|||
user_info = FacebookUserInfo.find_by(facebook_user_id: facebook_hash[:facebook_user_id])
|
||||
result.user = user_info.try(:user)
|
||||
|
||||
if !result.user && !email.blank? && result.user = User.find_by(email: Email.downcase(email))
|
||||
if !result.user && !email.blank? && result.user = User.find_by_email(email)
|
||||
FacebookUserInfo.create({user_id: result.user.id}.merge(facebook_hash))
|
||||
end
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ class Auth::GoogleOAuth2Authenticator < Auth::Authenticator
|
|||
user_info = GoogleUserInfo.find_by(google_user_id: google_hash[:google_user_id])
|
||||
result.user = user_info.try(:user)
|
||||
|
||||
if !result.user && !result.email.blank? && result.user = User.find_by(email: Email.downcase(result.email))
|
||||
if !result.user && !result.email.blank? && result.user = User.find_by_email(result.email)
|
||||
GoogleUserInfo.create({user_id: result.user.id}.merge(google_hash))
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue