Class: Clearance::Token

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

Overview

Random token used for password reset and remember tokens. Clearance tokens are also public API and are intended 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.

Returns:

  • (String)


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

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