Sha256: 8ca54e46502d69ae645b8d454421801376812efd80f7537770dac82caea9df5e
Contents?: true
Size: 518 Bytes
Versions: 9
Compression:
Stored size: 518 Bytes
Contents
module Forge3::SecretToken LOCATION = if Rails.env.production? "/var/apps/#{File.basename(Dir.pwd)}/shared/secret_token.txt" else 'config/secret_token.txt' end begin Forge3::Application.config.secret_token = File.read(LOCATION) rescue Errno::ENOENT $stderr.puts "WARNING: Couldn't find a secret token. Generating one now..." Forge3::Application.config.secret_token = SecureRandom.hex(64) File.open(LOCATION, 'w') { |f| f.write(Forge3::Application.config.secret_token) } end end
Version data entries
9 entries across 9 versions & 1 rubygems