Get secret_token from ENV['SECRET_TOKEN'] (e.g. for Heroku)

This commit is contained in:
Michael Berg 2013-03-01 23:55:49 +01:00
parent 5c986be753
commit de154f3ef1

View File

@ -13,6 +13,9 @@
if Rails.env.test? || Rails.env.development?
Discourse::Application.config.secret_token = "47f5390004bf6d25bb97083fb98e7cc133ab450ba814dd19638a78282b4ca291"
else
raise "You must set a secret token in config/initializers/secret_token.rb"
if Rails.env.production? && ENV['SECRET_TOKEN'].blank?
raise 'SECRET_TOKEN environment variable must be set!'
end
Discourse::Application.config.secret_token = ENV['SECRET_TOKEN']
end