Module: Clearance::PasswordStrategies

Defined in:
lib/clearance/password_strategies.rb,
lib/clearance/password_strategies/argon2.rb,
lib/clearance/password_strategies/bcrypt.rb

Overview

Control how users are authenticated and how passwords are stored.

The default password strategy is BCrypt, but this can be overridden in Configuration.

You can supply your own password strategy by implementing a module that responds to the proper interface methods. Once this module is configured as your password strategy, Clearance will mix it into your Clearance User class. Thus, your module can access any methods or attributes on User.

Password strategies need to respond to authenticated?(password) and password=(new_password). For an example of how to implement these methods, see BCrypt.

Defined Under Namespace

Modules: Argon2, BCrypt