mirror of
https://github.com/SuiteCRM/SuiteCRM-Core.git
synced 2025-09-02 08:09:19 +08:00
Fix incorrect backup codes showing
This commit is contained in:
parent
5d96e6132b
commit
803c4f741c
2 changed files with 3 additions and 1 deletions
|
@ -173,6 +173,7 @@ export class TwoFactorComponent implements OnInit {
|
|||
}
|
||||
|
||||
public generateCodes(): void {
|
||||
this.backupCodes = null;
|
||||
this.generateBackupCodesService.generate().subscribe({
|
||||
next: (response) => {
|
||||
this.backupCodes = response?.data.backupCodes;
|
||||
|
@ -197,6 +198,7 @@ export class TwoFactorComponent implements OnInit {
|
|||
|
||||
this.areRecoveryCodesGenerated.set(false)
|
||||
this.generateCodes()
|
||||
this.message.addSuccessMessageByKey('LBL_REGENERATED_BACKUP_CODES');
|
||||
}).catch();
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ class SecurityController extends AbstractController
|
|||
$this->userHandler->setUserPreference('is_two_factor_enabled', false);
|
||||
|
||||
$this->preparedStatementHandler->update(
|
||||
'UPDATE users SET totp_secret = NULL, is_totp_enabled = 0 WHERE id = :id',
|
||||
'UPDATE users SET totp_secret = NULL, is_totp_enabled = 0, backup_codes = NULL WHERE id = :id',
|
||||
['id' => $id],
|
||||
[['param' => 'id', 'type' => 'string']]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue