diff options
author | azul <azul@riseup.net> | 2017-03-23 08:36:07 +0000 |
---|---|---|
committer | azul <azul@riseup.net> | 2017-03-23 08:36:07 +0000 |
commit | 3efe125d6e3bd5f4eecd18952376ffc37e09b9c5 (patch) | |
tree | 30640dfeafa9f847901bb149635a1a781ab51d9b /config/initializers/secret_token.rb | |
parent | 2989f4142576de191b16832b53c3d1e70701d286 (diff) | |
parent | d03082680007d30b8883495c2ae5110daec14f71 (diff) |
Merge branch 'upgrade/secret-key-base' into 'master'
upgrade: use rails4s 'secret_key_base'
Closes #23
See merge request !24
Diffstat (limited to 'config/initializers/secret_token.rb')
-rw-r--r-- | config/initializers/secret_token.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index bdd9b1c..4a2e6d7 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -5,8 +5,14 @@ # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -if token = APP_CONFIG[:secret_token] - LeapWeb::Application.config.secret_token = token -else - raise StandardError.new("No secret_token defined in config/config.yml - please provide one.") +unless APP_CONFIG[:secret_key_base] or APP_CONFIG[:secret_token] + raise StandardError.new("No secret_key_base or secret_token defined in config/config.yml - please provide one.") +end + +if APP_CONFIG[:secret_key_base] + LeapWeb::Application.config.secret_key_base = APP_CONFIG[:secret_key_base] +end + +if APP_CONFIG[:secret_token] + LeapWeb::Application.config.secret_token = APP_CONFIG[:secret_token] end |