mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
Revert "DEV: Let OmniAuth strategies return auth result. (#7833)"
This reverts commit dc5eb7655148742593257dbe690d829c264f26d2. It is better to keep any custom redirect logic within omniauth, without relying on the app
This commit is contained in:
@ -12,7 +12,6 @@ RSpec.describe Users::OmniauthCallbacksController do
|
||||
|
||||
after do
|
||||
Rails.application.env_config["omniauth.auth"] = OmniAuth.config.mock_auth[:google_oauth2] = nil
|
||||
Rails.application.env_config["omniauth.result"] = nil
|
||||
OmniAuth.config.test_mode = false
|
||||
end
|
||||
|
||||
@ -80,25 +79,6 @@ RSpec.describe Users::OmniauthCallbacksController do
|
||||
end
|
||||
end
|
||||
|
||||
describe '.complete' do
|
||||
it 'will return result if present' do
|
||||
result = Auth::Result.new
|
||||
result.user = Fabricate(:user)
|
||||
result.authenticated = true
|
||||
result.destination_url = "/anotherpath"
|
||||
|
||||
Rails.application.env_config["omniauth.origin"] = '/somepath'
|
||||
Rails.application.env_config["omniauth.result"] = result
|
||||
|
||||
get "/auth/test/callback.json"
|
||||
response_body = JSON.parse(response.body)
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(response_body["authenticated"]).to eq(true)
|
||||
expect(response_body["destination_url"]).to eq("/anotherpath")
|
||||
end
|
||||
end
|
||||
|
||||
context 'Google Oauth2' do
|
||||
before do
|
||||
SiteSetting.enable_google_oauth2_logins = true
|
||||
|
Reference in New Issue
Block a user