Module: Sorcery::Model::TemporaryToken
- Defined in:
- lib/sorcery/model/temporary_token.rb
Overview
This module encapsulates the logic for temporary token. A temporary token is created to identify a user in scenarios such as reseting password and activating the user by email.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.generate_random_token ⇒ Object
Random code, used for salt and temporary tokens.
- .included(base) ⇒ Object
Class Method Details
.generate_random_token ⇒ Object
Random code, used for salt and temporary tokens.
12 13 14 |
# File 'lib/sorcery/model/temporary_token.rb', line 12 def self.generate_random_token Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join ) end |
.included(base) ⇒ Object
7 8 9 |
# File 'lib/sorcery/model/temporary_token.rb', line 7 def self.included(base) base.extend(ClassMethods) end |