Module: Sorcery::Model::Submodules::RememberMe::InstanceMethods
- Defined in:
- lib/sorcery/model/submodules/remember_me.rb
Instance Method Summary collapse
-
#forget_me! ⇒ Object
You shouldn’t really use this one yourself - it’s called by the controller’s ‘forget_me!’ method.
-
#remember_me! ⇒ Object
You shouldn’t really use this one yourself - it’s called by the controller’s ‘remember_me!’ method.
Instance Method Details
#forget_me! ⇒ Object
You shouldn’t really use this one yourself - it’s called by the controller’s ‘forget_me!’ method.
58 59 60 61 62 63 |
# File 'lib/sorcery/model/submodules/remember_me.rb', line 58 def forget_me! config = sorcery_config self.send(:"#{config.remember_me_token_attribute_name}=", nil) self.send(:"#{config.remember_me_token_expires_at_attribute_name}=", nil) self.save!(:validate => false) end |
#remember_me! ⇒ Object
You shouldn’t really use this one yourself - it’s called by the controller’s ‘remember_me!’ method.
50 51 52 53 54 55 |
# File 'lib/sorcery/model/submodules/remember_me.rb', line 50 def remember_me! config = sorcery_config self.send(:"#{config.remember_me_token_attribute_name}=", TemporaryToken.generate_random_token) self.send(:"#{config.remember_me_token_expires_at_attribute_name}=", Time.now.in_time_zone + config.remember_me_for) self.save!(:validate => false) end |