class Clearance::Token

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).

Public Class Methods

new() click to toggle source

Generate a new random, 20 byte hex token.

@return [String]

# File lib/clearance/token.rb, line 10
def self.new
  SecureRandom.hex(20).encode('UTF-8')
end