Sha256: 87c2637f4d31cbf6e02ea833df930bb22f616ac369413c8a4ffb23db0effe12e

Contents?: true

Size: 588 Bytes

Versions: 20

Compression:

Stored size: 588 Bytes

Contents

# Be sure to restart your server when you modify this file.

# Make sure your secret_key_base is kept private
# if you're sharing your code publicly, such as by adding
# .secret to your .gitignore file.

require 'securerandom'

def 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 and store it in token_file.
    token = SecureRandom.hex(64)
    File.write(token_file, token)
    token
  end
end

SampleApp::Application.config.secret_key_base = secure_token

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
rails_magic_renamer-2.0.0.pre.alpha spec/support/sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.4.2 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.4.1 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.3.2 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.3.1 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.3 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.4 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.3 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.11 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.10 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.9 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.8 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.7 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.6 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.5 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.4 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.3 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.2 sample_app_rails_4/config/initializers/secret_token.rb
active_mocker-1.2.pre.1 sample_app_rails_4/config/initializers/secret_token.rb