Documentation

ResetPasswordWithRecoveryCode

Reset a password using a one-time recovery code.

Tags
since
3.1.2

Table of Contents

Constants

INVALID_MESSAGE  = 'Invalid username or recovery code.'
Generic message used for every failure, to avoid leaking which part was wrong.

Properties

$passwordHasher  : PasswordHasher
$recoveryCodes  : RecoveryCodeService
$repository  : UserRepositoryInterface

Methods

__construct()  : mixed
execute()  : string
Reset the password and rotate the recovery code.

Constants

INVALID_MESSAGE

Generic message used for every failure, to avoid leaking which part was wrong.

public mixed INVALID_MESSAGE = 'Invalid username or recovery code.'

Properties

Methods

execute()

Reset the password and rotate the recovery code.

public execute(string $username, string $code, string $newPassword) : string
Parameters
$username : string

The account username.

$code : string

The recovery code as typed by the user.

$newPassword : string

The new password.

Tags
throws
InvalidArgumentException

On any failure (uniform message) or a weak password.

Return values
string

The new recovery code (plaintext, shown once).


        
On this page

Search results