Module: Authem::User

Extended by:
ActiveSupport::Concern
Defined in:
lib/authem/user.rb

Instance Method Summary collapse

Instance Method Details

#email=(value) ⇒ Object



17
18
19
# File 'lib/authem/user.rb', line 17

def email=(value)
  super value.try(:downcase)
end

#reset_password(password, confirmation) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/authem/user.rb', line 21

def reset_password(password, confirmation)
  if password.blank?
    errors.add :password, :blank
    return false
  end

  self.password = password
  self.password_confirmation = confirmation

  update_column :password_reset_token, Authem::Token.generate if save
end