Class: Kingsman::Strategies::Base
- Inherits:
-
Warden::Strategies::Base
- Object
- Warden::Strategies::Base
- Kingsman::Strategies::Base
- Defined in:
- lib/kingsman/strategies/base.rb
Overview
Base strategy for Kingsman. Responsible for verifying correct scope and mapping.
Direct Known Subclasses
Instance Method Summary collapse
-
#mapping ⇒ Object
Checks if a valid scope was given for kingsman and find mapping based on this scope.
-
#store? ⇒ Boolean
Whenever CSRF cannot be verified, we turn off any kind of storage.
Instance Method Details
#mapping ⇒ Object
Checks if a valid scope was given for kingsman and find mapping based on this scope.
13 14 15 16 17 18 19 |
# File 'lib/kingsman/strategies/base.rb', line 13 def mapping @mapping ||= begin mapping = Kingsman.mappings[scope] raise "Could not find mapping for #{scope}" unless mapping mapping end end |
#store? ⇒ Boolean
Whenever CSRF cannot be verified, we turn off any kind of storage
8 9 10 |
# File 'lib/kingsman/strategies/base.rb', line 8 def store? !env["kingsman.skip_storage"] end |