Class: Mack::Utils::AuthenticityTokenDispenser
- Includes:
- Singleton
- Defined in:
- lib/mack/utils/forgery_detector.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#dispense_token(key) ⇒ Object
:nodoc:.
Instance Method Details
#dispense_token(key) ⇒ Object
:nodoc:
144 145 146 147 148 149 |
# File 'lib/mack/utils/forgery_detector.rb', line 144 def dispense_token(key) # :nodoc: salt = configatron.mack.retrieve(:request_authenticity_token_salt, "shh, it's a secret") salt = "shh, it's a secret" if salt.empty? string_to_hash = key.to_s + salt.to_s Digest::SHA1.hexdigest(string_to_hash) end |