mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 19:37:55 +08:00
FIX: Update remaining backup code count after creation (#22475)
This commit is contained in:
parent
0b16fc8172
commit
049c4b606a
|
@ -47,6 +47,7 @@ export default class SecondFactorBackupEdit extends Component {
|
|||
this.args.model.setBackupEnabled(true);
|
||||
this.backupEnabled = true;
|
||||
this.remainingCodes = response.backup_codes.length;
|
||||
this.args.model.setCodesRemaining(this.remainingCodes);
|
||||
})
|
||||
.catch((error) => {
|
||||
this.args.closeModal();
|
||||
|
|
|
@ -68,6 +68,11 @@ export default Controller.extend(CanCheckEmails, {
|
|||
this.set("backupEnabled", value);
|
||||
},
|
||||
|
||||
@action
|
||||
setCodesRemaining(value) {
|
||||
this.model.set("second_factor_remaining_backup_codes", value);
|
||||
},
|
||||
|
||||
@action
|
||||
loadSecondFactors() {
|
||||
if (this.dirty === false) {
|
||||
|
@ -322,6 +327,7 @@ export default Controller.extend(CanCheckEmails, {
|
|||
markDirty: () => this.markDirty(),
|
||||
onError: (e) => this.handleError(e),
|
||||
setBackupEnabled: (e) => this.setBackupEnabled(e),
|
||||
setCodesRemaining: (e) => this.setCodesRemaining(e),
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user