Skip to content

Instantly share code, notes, and snippets.

@morshedalam
Created October 26, 2013 06:47
Show Gist options
  • Select an option

  • Save morshedalam/17380d31aec2a32ca7e1 to your computer and use it in GitHub Desktop.

Select an option

Save morshedalam/17380d31aec2a32ca7e1 to your computer and use it in GitHub Desktop.
require 'securerandom'
def find_secure_token
token_file = Rails.root.join('.secret_token')
if File.exist? token_file
File.read(token_file).chomp
else
token = SecureRandom.hex(64)
f = File.new(token_file, 'w')
f.write(token)
f.close
token
end
end
Rally::Application.config.secret_token = find_secure_token
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment