mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:12:45 +08:00
add some explicit scoping to help avoid erratic failure in test
This commit is contained in:
parent
99f4d5082b
commit
8d80a5d97e
|
@ -8,20 +8,20 @@ class Auth::GoogleOAuth2Authenticator < Auth::Authenticator
|
|||
session_info = parse_hash(auth_hash)
|
||||
google_hash = session_info[:google]
|
||||
|
||||
result = Auth::Result.new
|
||||
result = ::Auth::Result.new
|
||||
result.email = session_info[:email]
|
||||
result.email_valid = session_info[:email_valid]
|
||||
result.name = session_info[:name]
|
||||
|
||||
result.extra_data = google_hash
|
||||
|
||||
user_info = GoogleUserInfo.find_by(google_user_id: google_hash[:google_user_id])
|
||||
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.email_valid
|
||||
result.user = User.find_by_email(result.email)
|
||||
if result.user
|
||||
GoogleUserInfo.create({user_id: result.user.id}.merge(google_hash))
|
||||
::GoogleUserInfo.create({user_id: result.user.id}.merge(google_hash))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user