REFACTOR: Migrate GoogleOAuth2Authenticator to use ManagedAuthenticator (#7120)

https://meta.discourse.org/t/future-social-authentication-improvements/94691/3
This commit is contained in:
David Taylor
2019-03-07 11:31:04 +00:00
committed by GitHub
parent 6420b73c33
commit fc7938f7e0
13 changed files with 71 additions and 161 deletions

View File

@ -151,7 +151,7 @@ class BulkImport::DiscourseMerger < BulkImport::Base
copy_model(c, skip_if_merged: true, is_a_user_model: true, skip_processing: true)
end
[UserAssociatedAccount, GithubUserInfo, GoogleUserInfo, Oauth2UserInfo,
[UserAssociatedAccount, GithubUserInfo, Oauth2UserInfo,
SingleSignOnRecord, EmailChangeRequest
].each do |c|
copy_model(c, skip_if_merged: true, is_a_user_model: true)
@ -628,11 +628,6 @@ class BulkImport::DiscourseMerger < BulkImport::Base
r
end
def process_google_user_info(r)
return nil if GoogleUserInfo.where(google_user_id: r['google_user_id']).exists?
r
end
def process_oauth2_user_info(r)
return nil if Oauth2UserInfo.where(uid: r['uid'], provider: r['provider']).exists?
r