mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-02 08:09:19 +08:00
Fix backup codes not deleting
This commit is contained in:
parent
c7eb2027ed
commit
90bff782b5
1 changed files with 4 additions and 3 deletions
|
@ -1320,12 +1320,13 @@ class User implements UserInterface, EquatableInterface, PasswordAuthenticatedUs
|
|||
*/
|
||||
public function invalidateBackupCode(string $code): void
|
||||
{
|
||||
$key = array_search($code, $this->getBackupCodes(), true);
|
||||
$backupCodes = $this->getBackupCodes();
|
||||
$key = array_search($code, $backupCodes, true);
|
||||
if ($key !== false){
|
||||
unset($this->getBackupCodes()[$key]);
|
||||
unset($backupCodes[$key]);
|
||||
}
|
||||
|
||||
$this->backupCodes = array_values($this->backupCodes);
|
||||
$this->setBackupCodes(array_values($backupCodes));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue