FC initializers: simplify
This commit is contained in:
parent
f8519c5345
commit
b35a88ffd4
1 changed files with 10 additions and 8 deletions
|
@ -1,11 +1,4 @@
|
||||||
FRANCE_CONNECT = if !Rails.env.test?
|
FRANCE_CONNECT = if Rails.env.test?
|
||||||
file_path = "#{Rails.root}/config/france_connect.yml"
|
|
||||||
config_hash = YAML.safe_load(File.read(file_path))
|
|
||||||
.reduce({}) { |acc, (key, value)| acc[key.gsub('particulier_', '')] = value, acc }
|
|
||||||
.symbolize_keys
|
|
||||||
|
|
||||||
{ particulier: config_hash }
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
particulier: {
|
particulier: {
|
||||||
identifier: 'plop',
|
identifier: 'plop',
|
||||||
|
@ -17,4 +10,13 @@ else
|
||||||
logout_endpoint: 'https://bidon.com/endpoint',
|
logout_endpoint: 'https://bidon.com/endpoint',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
fc_config_file_path = "#{Rails.root}/config/france_connect.yml"
|
||||||
|
|
||||||
|
# FIXME: with a yaml with a { particulier: {} } structure
|
||||||
|
config_hash = YAML.safe_load(File.read(fc_config_file_path))
|
||||||
|
.reduce({}) { |acc, (key, value)| acc[key.gsub('particulier_', '')] = value; acc }
|
||||||
|
.symbolize_keys
|
||||||
|
|
||||||
|
{ particulier: config_hash }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue