Skip to Content Skip to Search
Namespace
Methods
A
L
R

Constants

DEFAULT_RESET_TOKEN_EXPIRES_IN = 15.minutes
 

Class Public methods

algorithm_registry()

Returns the registry of password algorithms

# File activemodel/lib/active_model/secure_password.rb, line 17
def algorithm_registry
  @algorithm_registry ||= {}
end

lookup_algorithm(name)

Looks up a registered algorithm by name

# File activemodel/lib/active_model/secure_password.rb, line 31
def lookup_algorithm(name)
  algorithm_registry[name.to_sym]
end

register_algorithm(name, algorithm_class)

Registers a password algorithm for use with has_secure_password

ActiveModel::SecurePassword.register_algorithm :argon2, Argon2Password

The algorithm class will be instantiated when used.

# File activemodel/lib/active_model/secure_password.rb, line 26
def register_algorithm(name, algorithm_class)
  algorithm_registry[name.to_sym] = algorithm_class
end