Skip to content
Snippets Groups Projects
Unverified Commit 40a54790 authored by Andrej Shadura's avatar Andrej Shadura
Browse files

Initialise CONFIG['sso_auth'] to an empty hash


An empty hash can be iterated, but a false value (unset) cannot be.
Even though we no longer iterate this hash in the initialiser, we
do so elsewhere in the code.

Signed-off-by: Andrej Shadura's avatarAndrej Shadura <andrew.shadura@collabora.co.uk>
parent f1268024
No related branches found
No related tags found
No related merge requests found
Pipeline #35914 passed
...@@ -2,15 +2,15 @@ OmniAuth.config.path_prefix = '/user/sso' ...@@ -2,15 +2,15 @@ OmniAuth.config.path_prefix = '/user/sso'
path = Rails.root.join("config", "auth.yml") path = Rails.root.join("config", "auth.yml")
CONFIG['sso_auth'] = Hash.new
if File.exist? path if File.exist? path
begin begin
CONFIG['sso_auth'] = YAML.load_file(path) CONFIG['sso_auth'] = YAML.load_file(path)
rescue Exception rescue Exception
puts "Error while parsing config file #{path}" puts "Error while parsing config file #{path}"
CONFIG['sso_auth'] = Hash.new
end end
if CONFIG['sso_auth']
Rails.application.config.middleware.use OmniAuth::Builder do Rails.application.config.middleware.use OmniAuth::Builder do
CONFIG['sso_auth'].each do |name, options| CONFIG['sso_auth'].each do |name, options|
options[:name] = name options[:name] = name
...@@ -18,4 +18,3 @@ if File.exist? path ...@@ -18,4 +18,3 @@ if File.exist? path
end end
end end
end end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment