Created
May 20, 2013 04:53
-
-
Save derekrockwell/5610486 to your computer and use it in GitHub Desktop.
Good way of handling secret tokens within apps (leveraging Heroku config variables or some other server based environment variables) Source: http://daniel.fone.net.nz/blog/2013/05/20/a-better-way-to-manage-the-rails-secret-token/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MyApp::Application.config.secret_token = if Rails.env.development? or Rails.env.test? | |
('x' * 30) # meets minimum requirement of 30 chars long | |
else | |
ENV['SECRET_TOKEN'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment