Commit b29171d9ec430c35413335eb6a8cbe83383c46c6
1 parent
cad9572e
Exists in
spb-stable
and in
3 other branches
Allow to specify secret token via environment variable.
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
config/initializers/secret_token.rb
... | ... | @@ -9,7 +9,9 @@ require 'securerandom' |
9 | 9 | |
10 | 10 | def find_secure_token |
11 | 11 | token_file = Rails.root.join('.secret') |
12 | - if File.exist? token_file | |
12 | + if ENV.key?('SECRET_KEY_BASE') | |
13 | + ENV['SECRET_KEY_BASE'] | |
14 | + elsif File.exist? token_file | |
13 | 15 | # Use the existing token. |
14 | 16 | File.read(token_file).chomp |
15 | 17 | else | ... | ... |