mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
BUGFIX: allow facebook auth for people refusing email
This commit is contained in:
parent
abb2de22ab
commit
70c50d321a
1 changed files with 2 additions and 2 deletions
|
@ -13,14 +13,14 @@ class Auth::FacebookAuthenticator < Auth::Authenticator
|
|||
|
||||
result.email = email = session_info[:email]
|
||||
result.email_valid = true
|
||||
result.name = name = facebook_hash[:name]
|
||||
result.name = facebook_hash[:name]
|
||||
|
||||
result.extra_data = facebook_hash
|
||||
|
||||
user_info = FacebookUserInfo.where(facebook_user_id: facebook_hash[:facebook_user_id]).first
|
||||
result.user = user_info.try(:user)
|
||||
|
||||
if !result.user && result.user = User.where(email: Email.downcase(email)).first
|
||||
if !result.user && !email.blank? && result.user = User.where(email: Email.downcase(email)).first
|
||||
FacebookUserInfo.create({user_id: result.user.id}.merge(facebook_hash))
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue