FIX: support connecting GitHub with existing accounts

This commit is contained in:
Sam 2018-12-10 09:27:00 +11:00
parent c84b837d50
commit 502a0fe778
2 changed files with 6 additions and 0 deletions

View File

@ -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

View File

@ -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)