mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: Allow linking an existing account during external-auth signup
When a user signs up via an external auth method, a new link is added to the signup modal which allows them to connect an existing Discourse account. This will only happen if: - There is at least 1 other auth method available and - The current auth method permits users to disconnect/reconnect their accounts themselves
This commit is contained in:
@ -246,6 +246,19 @@ RSpec.describe Users::OmniauthCallbacksController do
|
||||
expect(data["destination_url"]).to eq(destination_url)
|
||||
end
|
||||
|
||||
it 'should return an associate url when multiple login methods are enabled' do
|
||||
get "/auth/google_oauth2/callback.json"
|
||||
expect(response.status).to eq(302)
|
||||
|
||||
data = JSON.parse(cookies[:authentication_data])
|
||||
expect(data["associate_url"]).to start_with('/associate/')
|
||||
|
||||
SiteSetting.enable_local_logins = false
|
||||
get "/auth/google_oauth2/callback.json"
|
||||
data = JSON.parse(cookies[:authentication_data])
|
||||
expect(data["associate_url"]).to eq(nil)
|
||||
end
|
||||
|
||||
describe 'when site is invite_only' do
|
||||
before do
|
||||
SiteSetting.invite_only = true
|
||||
|
Reference in New Issue
Block a user