Sha256: 3e67aab699505fb97ba06ee45a53dedef6bad0a7f71bff77f2f08c27e715d494

Contents?: true

Size: 674 Bytes

Versions: 17

Compression:

Stored size: 674 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)

        if validate(resource){ resource.valid_password?(password) }
          resource.after_database_authentication
          success!(resource)
        else
          fail(:invalid)
        end
      end
    end
  end
end

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

Version data entries

17 entries across 17 versions & 6 rubygems

Version Path
devise-1.1.8 lib/devise/strategies/database_authenticatable.rb
devise-jdguyot-1.2.rc2 lib/devise/strategies/database_authenticatable.rb
devise-1.1.7 lib/devise/strategies/database_authenticatable.rb
devise-1.1.6 lib/devise/strategies/database_authenticatable.rb
devise-jdguyot-1.2.rc lib/devise/strategies/database_authenticatable.rb
devise-1.1.5 lib/devise/strategies/database_authenticatable.rb
devise-1.1.4 lib/devise/strategies/database_authenticatable.rb
devise-1.2.rc lib/devise/strategies/database_authenticatable.rb
aihs_devise-1.2.rc lib/devise/strategies/database_authenticatable.rb
gonow-devise-1.2.rc lib/devise/strategies/database_authenticatable.rb
devise-edge-1.2.rc lib/devise/strategies/database_authenticatable.rb
devise-1.1.3 lib/devise/strategies/database_authenticatable.rb
devise-1.1.2 lib/devise/strategies/database_authenticatable.rb
devise-1.1.1 lib/devise/strategies/database_authenticatable.rb
devise-1.1.0 lib/devise/strategies/database_authenticatable.rb
namxam-devise-1.1.0.win lib/devise/strategies/database_authenticatable.rb
devise-1.1.rc2 lib/devise/strategies/database_authenticatable.rb