module Sorcery::Model::TemporaryToken

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.

Public Class Methods

generate_random_token() click to toggle source

Random code, used for salt and temporary tokens.

# File lib/sorcery/model/temporary_token.rb, line 16
def self.generate_random_token
  SecureRandom.urlsafe_base64(@sorcery_config.token_randomness).tr('lIO0', 'sxyz')
end
included(base) click to toggle source
# File lib/sorcery/model/temporary_token.rb, line 9
def self.included(base)
  # FIXME: This may not be the ideal way of passing sorcery_config to generate_random_token.
  @sorcery_config = base.sorcery_config
  base.extend(ClassMethods)
end