Sha256: f634418f5288257929c96b52a73672e941f81a8f2b6cd29c90e9c54752710bfd

Contents?: true

Size: 606 Bytes

Versions: 37

Compression:

Stored size: 606 Bytes

Contents

module Devise
  module Strategies
    # Base strategy for Devise. Responsible for verifying correct scope and mapping.
    class Base < ::Warden::Strategies::Base
      # Whenever CSRF cannot be verified, we turn off any kind of storage
      def store?
        !env["devise.skip_storage"]
      end

      # Checks if a valid scope was given for devise and find mapping based on this scope.
      def mapping
        @mapping ||= begin
          mapping = Devise.mappings[scope]
          raise "Could not find mapping for #{scope}" unless mapping
          mapping
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 5 rubygems

Version Path
devise-3.2.2 lib/devise/strategies/base.rb
devise-3.2.1 lib/devise/strategies/base.rb
devise-3.1.2 lib/devise/strategies/base.rb
devise-3.0.4 lib/devise/strategies/base.rb
devise-2.2.8 lib/devise/strategies/base.rb
devise-3.2.0 lib/devise/strategies/base.rb
loyal_devise-2.2.6 lib/devise/strategies/base.rb
devise-3.1.1 lib/devise/strategies/base.rb
devise-3.1.0 lib/devise/strategies/base.rb
devise-2.1.4 lib/devise/strategies/base.rb
devise-2.2.7 lib/devise/strategies/base.rb
devise-3.0.3 lib/devise/strategies/base.rb
devise-3.1.0.rc2 lib/devise/strategies/base.rb
loyal_devise-2.2.5 lib/devise/strategies/base.rb
devise-2.2.6 lib/devise/strategies/base.rb
devise-3.0.2 lib/devise/strategies/base.rb
devise-3.0.1 lib/devise/strategies/base.rb
devise-2.2.5 lib/devise/strategies/base.rb
loyal_devise-2.1.10 lib/devise/strategies/base.rb
loyal_devise-2.1.7 lib/devise/strategies/base.rb