Allow to specify secret token via environment variable.

This commit is contained in:
Cyril Rohr 2014-04-15 17:57:07 +01:00
parent cad9572ee9
commit b29171d9ec
1 changed files with 3 additions and 1 deletions

View File

@ -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