Class: Clearance::Token
- Inherits:
-
Object
- Object
- Clearance::Token
- 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
-
.new ⇒ String
Generate a new random, 20 byte hex token.
Class Method Details
.new ⇒ String
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 |