Fixed two factor authentication exception

This commit is contained in:
Jan Böhmer 2022-09-25 00:54:31 +02:00
parent 767bf763b8
commit 6a6ff152ab

View file

@ -762,7 +762,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
*/ */
public function isBackupCode(string $code): bool public function isBackupCode(string $code): bool
{ {
return in_array($code, $this->backupCodes, true); return in_array($code, $this->getBackupCodes(), true);
} }
/** /**
@ -772,7 +772,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
*/ */
public function invalidateBackupCode(string $code): void public function invalidateBackupCode(string $code): void
{ {
$key = array_search($code, $this->backupCodes, true); $key = array_search($code, $this->getBackupCodes(), true);
if (false !== $key) { if (false !== $key) {
unset($this->backupCodes[$key]); unset($this->backupCodes[$key]);
} }