Class: Clearance::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/clearance/token.rb

Overview

Random token used for password reset tokens and password reset tokens. Clearance tokens are also public API and are inteded to be used anywhere you need a random token to correspond to a given user (e.g. you added an email confirmation token).

Class Method Summary collapse

Class Method Details

.newString

Generate a new random, 20 byte hex token.


10
11
12
# File 'lib/clearance/token.rb', line 10

def self.new
  SecureRandom.hex(20).encode('UTF-8')
end