Skip to content

class Athena::Security::Authenticator::Passport::Badge::PasswordUpgrade
inherits Reference #

Upgrades the hashed password of the user once it is authenticated, if its password hasher needs to rehash it, e.g. because its cost was increased.

See ASEC::Listeners::PasswordMigrating.

Included modules

Athena::Security::Authenticator::Passport::Badge::Interface

Constructors#

.new(plaintext_password : String, password_upgrader : ASEC::User::PasswordUpgraderInterface | Nil = nil)#

Creates a badge with the plaintext_password presented by the user, which is hashed into its new password, and optionally the password_upgrader persisting it.

View source

Methods#

#erase_plaintext_password : String#

Erases the plaintext password presented by the user from this badge, and returns it.

Raises an ASEC::Exception::Logic if it was already erased.

View source

#password_upgrader : ASEC::User::PasswordUpgraderInterface | ::Nil#

Returns the upgrader persisting the new hashed password, if any.

Without one, the password is upgraded through the user provider set on the ASEC::Authenticator::Passport::Badge::User, if it is an ASEC::User::PasswordUpgraderInterface.

View source

#resolved? : Bool#

Returns true if this badge was checked by the security system, otherwise false.

Every badge of a passport must be resolved once it was checked, otherwise the authentication fails.

View source