Sha256: 04441f59dd845891ced4ac1deb2ef5c4b1f428bf81fa5a8d17aaa6e6f78eb809

Contents?: true

Size: 682 Bytes

Versions: 5

Compression:

Stored size: 682 Bytes

Contents

require 'devise/strategies/authenticatable'

module Devise
  module Strategies
    # Default strategy for signing in a user, based on his email and password in the database.
    class DatabaseAuthenticatable < Authenticatable
      def authenticate!
        resource = valid_password? && mapping.to.find_for_database_authentication(authentication_hash)
        return fail(:invalid) unless resource

        if validate(resource){ resource.valid_password?(password) }
          resource.after_database_authentication
          success!(resource)
        end
      end
    end
  end
end

Warden::Strategies.add(:database_authenticatable, Devise::Strategies::DatabaseAuthenticatable)

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
devise-2.1.4 lib/devise/strategies/database_authenticatable.rb
devise-2.1.3 lib/devise/strategies/database_authenticatable.rb
af-devise-2.1.2 lib/devise/strategies/database_authenticatable.rb
devise-2.1.2 lib/devise/strategies/database_authenticatable.rb
rmello-devise-2.1.0.2 lib/devise/strategies/database_authenticatable.rb