Sha256: c4040888e0de9eb72b1bcf05cb6e7f485f2fe23426c8da2ed7cf7684a440e505
Contents?: true
Size: 904 Bytes
Versions: 13
Compression:
Stored size: 904 Bytes
Contents
# Be sure to restart your server when you modify this file. # Your secret key is used 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. # You can use `rake secret` to generate a secure secret key. # Make sure your secret_key_base is kept private # if you're sharing your code publicly. def find_secure_token token_file = Rails.root.join('.secret') if File.exist? token_file # Use the existing token. File.read(token_file).chomp else # Generate a new token of 64 random hexadecimal characters and store it in token_file. token = SecureRandom.hex(64) File.write(token_file, token) token end end <%= app_name.classify %>::Application.config.secret_key_base = find_secure_token
Version data entries
13 entries across 13 versions & 1 rubygems