mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 04:03:45 +08:00
Allow plugins that implement OAuth and OAuth2 to show up under associated accounts in the Admin area. (#4333)
This commit is contained in:
parent
d55da4fe1b
commit
64bdededd3
|
@ -782,6 +782,7 @@ class User < ActiveRecord::Base
|
|||
result << "Facebook(#{facebook_user_info.username})" if facebook_user_info
|
||||
result << "Google(#{google_user_info.email})" if google_user_info
|
||||
result << "Github(#{github_user_info.screen_name})" if github_user_info
|
||||
result << "#{oauth2_user_info.provider}(#{oauth2_user_info.email})" if oauth2_user_info
|
||||
|
||||
user_open_ids.each do |oid|
|
||||
result << "OpenID #{oid.url[0..20]}...(#{oid.email})"
|
||||
|
|
|
@ -323,9 +323,10 @@ describe User do
|
|||
FacebookUserInfo.create(user_id: user.id, username: "sam", facebook_user_id: 1)
|
||||
GoogleUserInfo.create(user_id: user.id, email: "sam@sam.com", google_user_id: 1)
|
||||
GithubUserInfo.create(user_id: user.id, screen_name: "sam", github_user_id: 1)
|
||||
Oauth2UserInfo.create(user_id: user.id, provider: "linkedin", email: "sam@sam.com", uid: 1)
|
||||
|
||||
user.reload
|
||||
expect(user.associated_accounts).to eq("Twitter(sam), Facebook(sam), Google(sam@sam.com), Github(sam)")
|
||||
expect(user.associated_accounts).to eq("Twitter(sam), Facebook(sam), Google(sam@sam.com), Github(sam), linkedin(sam@sam.com)")
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user