Module: SimpleAuth::Authenticated::InstanceMethods
- Defined in:
- lib/simple_auth/authenticated.rb
Instance Method Summary collapse
- #authenticated?(password) ⇒ Boolean
- #confirm! ⇒ Object
- #forgot_password! ⇒ Object
- #reset_remember_token! ⇒ Object
Instance Method Details
#authenticated?(password) ⇒ Boolean
53 54 55 |
# File 'lib/simple_auth/authenticated.rb', line 53 def authenticated?(password) encrypted_password == encrypt(password) end |
#confirm! ⇒ Object
59 60 61 62 63 64 65 |
# File 'lib/simple_auth/authenticated.rb', line 59 def confirm! self.confirmed = true self.confirmation_token = nil primary_contact = self.contacts.where(:value => self.login , :confirmed => false).first primary_contact.confirm! save(:validate => false) end |
#forgot_password! ⇒ Object
72 73 74 75 |
# File 'lib/simple_auth/authenticated.rb', line 72 def forgot_password! generate_confirmation_token save(:validate => false) end |
#reset_remember_token! ⇒ Object
67 68 69 70 |
# File 'lib/simple_auth/authenticated.rb', line 67 def reset_remember_token! generate_remember_token save(:validate => false) end |