FIX: make work with user_emails migration

This commit is contained in:
Leo McArdle 2017-09-05 20:12:45 +01:00
parent be6b6ee9bb
commit 8fc2429496
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ class OAuth2BasicAuthenticator < ::Auth::OAuth2Authenticator
if current_info if current_info
result.user = User.where(id: current_info[:user_id]).first result.user = User.where(id: current_info[:user_id]).first
elsif SiteSetting.oauth2_email_verified? elsif SiteSetting.oauth2_email_verified?
result.user = User.where(email: Email.downcase(result.email)).first result.user = User.find_by_email(result.email)
if result.user && user_details[:user_id] if result.user && user_details[:user_id]
::PluginStore.set("oauth2_basic", "oauth2_basic_user_#{user_details[:user_id]}", user_id: result.user.id) ::PluginStore.set("oauth2_basic", "oauth2_basic_user_#{user_details[:user_id]}", user_id: result.user.id)
end end