Allow to specify secret token via environment variable.
This commit is contained in:
parent
cad9572ee9
commit
b29171d9ec
1 changed files with 3 additions and 1 deletions
|
@ -9,7 +9,9 @@ require 'securerandom'
|
|||
|
||||
def find_secure_token
|
||||
token_file = Rails.root.join('.secret')
|
||||
if File.exist? token_file
|
||||
if ENV.key?('SECRET_KEY_BASE')
|
||||
ENV['SECRET_KEY_BASE']
|
||||
elsif File.exist? token_file
|
||||
# Use the existing token.
|
||||
File.read(token_file).chomp
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue