Created
January 24, 2013 16:04
-
-
Save mikhailbortnyk/4623907 to your computer and use it in GitHub Desktop.
config/initializers/secret_token.rb
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
require 'clickworker-secure-config/helper'; include Clickworker::SecureConfig::Helper | |
# Be sure to restart your server when you modify this file. | |
# Your secret key for verifying the integrity of signed cookies. | |
# If you change this key, all old signed cookies will become invalid! | |
# Make sure the secret is at least 30 characters and all random, | |
# no regular words or you'll be exposed to dictionary attacks. | |
ClickworkerProfile::Application.config.secret_token = get_secret_by_key('profile.secret_token') || 'd69b09956e0ccef4351f239dcbbc3265' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
so, how it works.
get_secret_by_key
checksconfig.secure_reader
and if it nil - returns nil, so part after||
will be used. ifconfig.secure_reader
is not nil (it means we are not at development or test env) - it readssecret_token
from securified file.