module Sorcery::Model::Submodules::RememberMe::InstanceMethods
Public Instance Methods
force_forget_me!()
click to toggle source
You shouldn't really use this one yourself - it's called by the controller's 'force_forget_me!' method.
# File lib/sorcery/model/submodules/remember_me.rb, line 65 def force_forget_me! config = sorcery_config sorcery_adapter.update_attributes(config.remember_me_token_attribute_name => nil, config.remember_me_token_expires_at_attribute_name => nil) end
forget_me!()
click to toggle source
You shouldn't really use this one yourself - it's called by the controller's 'forget_me!' method. We only clear the token value if remember_me_token_persist_globally = true.
# File lib/sorcery/model/submodules/remember_me.rb, line 60 def forget_me! sorcery_config.remember_me_token_persist_globally || force_forget_me! end
has_remember_me_token?()
click to toggle source
# File lib/sorcery/model/submodules/remember_me.rb, line 54 def has_remember_me_token? send(sorcery_config.remember_me_token_attribute_name).present? end
remember_me!()
click to toggle source
You shouldn't really use this one yourself - it's called by the controller's 'remember_me!' method.
# File lib/sorcery/model/submodules/remember_me.rb, line 42 def remember_me! config = sorcery_config update_options = { config.remember_me_token_expires_at_attribute_name => Time.now.in_time_zone + config.remember_me_for } unless config.remember_me_token_persist_globally && has_remember_me_token? update_options[config.remember_me_token_attribute_name] = TemporaryToken.generate_random_token end sorcery_adapter.update_attributes(update_options) end