Expand description
Secure passwords and tokens (Rails has_secure_password / has_secure_token).
Passwords are hashed with bcrypt; a model exposes its stored digest via
HasSecurePassword to gain authenticate.
Traits§
- HasSecure
Password - Gives a model that stores a bcrypt digest an
authenticatemethod.
Functions§
- generate_
token - Generate an unguessable token (256 bits, hex) for
has_secure_tokenand one-off tokens (password reset, etc.). - hash_
password - Hash a password with bcrypt at the default cost.
- hash_
password_ with_ cost - Hash a password with an explicit bcrypt cost (higher = slower/safer).
- verify_
password - Verify a plaintext password against a bcrypt digest (false on any error).