# frozen_string_literal: true

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------

# 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.

#
# We should setup a secret token if FFCRM is running in application mode but NOT in engine mode.
# This functionality has been extracted to lib so it can be tested.
if FatFreeCRM.application?

  Rails.application.config.after_initialize do
    require 'fat_free_crm/secret_token_generator'

    FatFreeCRM::SecretTokenGenerator.setup!
  end
end
