FIX: Correct server error for starting SSO login, and add spec (#12010)
Followup to 821bb1e8cb
This commit is contained in:
parent
6d31ead050
commit
7e6cb1ff2e
|
@ -29,7 +29,7 @@ class SessionController < ApplicationController
|
||||||
if SiteSetting.verbose_discourse_connect_logging
|
if SiteSetting.verbose_discourse_connect_logging
|
||||||
Rails.logger.warn("Verbose SSO log: Started SSO process\n\n#{sso.diagnostics}")
|
Rails.logger.warn("Verbose SSO log: Started SSO process\n\n#{sso.diagnostics}")
|
||||||
end
|
end
|
||||||
redirect_to discourse_connect_url(sso)
|
redirect_to sso_url(sso)
|
||||||
else
|
else
|
||||||
render body: nil, status: 404
|
render body: nil, status: 404
|
||||||
end
|
end
|
||||||
|
|
|
@ -503,6 +503,20 @@ RSpec.describe SessionController do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#sso' do
|
||||||
|
before do
|
||||||
|
SiteSetting.discourse_connect_url = "http://example.com/discourse_sso"
|
||||||
|
SiteSetting.enable_discourse_connect = true
|
||||||
|
SiteSetting.discourse_connect_secret = "shjkfdhsfkjh"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "redirects correctly" do
|
||||||
|
get "/session/sso"
|
||||||
|
expect(response.status).to eq(302)
|
||||||
|
expect(response.location).to start_with(SiteSetting.discourse_connect_url)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '#sso_login' do
|
describe '#sso_login' do
|
||||||
before do
|
before do
|
||||||
@sso_url = "http://example.com/discourse_sso"
|
@sso_url = "http://example.com/discourse_sso"
|
||||||
|
|
Loading…
Reference in New Issue