Class: Devise::Strategies::Base

Inherits:
Warden::Strategies::Base
  • Object
show all
Defined in:
lib/devise/strategies/base.rb

Overview

Base strategy for Devise. Responsible for verifying correct scope and mapping.

Direct Known Subclasses

Authenticatable

Instance Method Summary collapse

Instance Method Details

#mappingObject

Checks if a valid scope was given for devise and find mapping based on this scope.



13
14
15
16
17
18
19
# File 'lib/devise/strategies/base.rb', line 13

def mapping
  @mapping ||= begin
    mapping = Devise.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

Returns:

  • (Boolean)


8
9
10
# File 'lib/devise/strategies/base.rb', line 8

def store?
  !env["devise.skip_storage"]
end