Sha256: 97cb14cd4fbfdf0b39dbd37ba9e5e7cfae9be50b3a95a17d741c6a8d74dae33e
Contents?: true
Size: 838 Bytes
Versions: 12
Compression:
Stored size: 838 Bytes
Contents
require 'devise/strategies/authenticatable' module Devise module Strategies # Default strategy for signing in a user, based on their email and password in the database. class DatabaseAuthenticatable < Authenticatable def authenticate! resource = password.present? && mapping.to.find_for_database_authentication(authentication_hash) hashed = false if validate(resource){ hashed = true; resource.valid_password?(password) } remember_me(resource) resource.after_database_authentication success!(resource) end mapping.to.new.password = password if !hashed && Devise.paranoid fail(:not_found_in_database) unless resource end end end end Warden::Strategies.add(:database_authenticatable, Devise::Strategies::DatabaseAuthenticatable)
Version data entries
12 entries across 12 versions & 3 rubygems