mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 03:10:46 -06:00
FIX: support connecting GitHub with existing accounts
This commit is contained in:
parent
c84b837d50
commit
502a0fe778
@ -41,6 +41,10 @@ class Auth::GithubAuthenticator < Auth::Authenticator
|
||||
|
||||
end
|
||||
|
||||
def can_connect_existing_user?
|
||||
true
|
||||
end
|
||||
|
||||
def after_authenticate(auth_token, existing_account: nil)
|
||||
result = Auth::Result.new
|
||||
|
||||
|
@ -235,6 +235,8 @@ describe Auth::GithubAuthenticator do
|
||||
user1 = Fabricate(:user)
|
||||
user2 = Fabricate(:user)
|
||||
|
||||
expect(authenticator.can_connect_existing_user?).to eq(true)
|
||||
|
||||
GithubUserInfo.create!(user_id: user1.id, github_user_id: 100, screen_name: "boris")
|
||||
|
||||
result = authenticator.after_authenticate(data, existing_account: user2)
|
||||
|
Loading…
Reference in New Issue
Block a user