Sha256: 0fcc3b9f50c8bbffdab50f96f5af91892a5cc02df6e24c3c113ff33b52ca08c8
Contents?: true
Size: 470 Bytes
Versions: 11
Compression:
Stored size: 470 Bytes
Contents
module Nyauth module Authenticatable extend ActiveSupport::Concern include Nyauth::PasswordDigestAbility include Nyauth::ResetPasswordAbility included do validates :email, presence: true end module ClassMethods def authenticate(given_email, given_password) record = where(email: given_email).last return nil unless record record.verify_password?(given_password) ? record : nil end end end end
Version data entries
11 entries across 11 versions & 1 rubygems