Skip to content
Snippets Groups Projects
Unverified Commit 2cc216cd authored by David Taylor's avatar David Taylor Committed by GitHub
Browse files

FIX: Ignore empty `saml_base_url` site setting (#51)

Regression introduced in e9f9150b
parent f42577cb
No related branches found
No related tags found
No related merge requests found
......@@ -369,7 +369,7 @@ class SamlAuthenticator < ::Auth::OAuth2Authenticator
end
def self.saml_base_url
DiscourseSaml.setting(:base_url) || Discourse.base_url
DiscourseSaml.setting(:base_url).presence || Discourse.base_url
end
end
......@@ -494,4 +494,15 @@ describe SamlAuthenticator do
end
end
end
describe ".base_url" do
it "works" do
expect(SamlAuthenticator.saml_base_url).to eq("http://test.localhost")
end
it "can be overriden by a setting" do
SiteSetting.saml_base_url = "https://override.example.com"
expect(SamlAuthenticator.saml_base_url).to eq("https://override.example.com")
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment