mirror of
https://github.com/discourse/discourse.git
synced 2025-04-26 01:34:33 +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.args.model.setBackupEnabled(true);
|
||||||
this.backupEnabled = true;
|
this.backupEnabled = true;
|
||||||
this.remainingCodes = response.backup_codes.length;
|
this.remainingCodes = response.backup_codes.length;
|
||||||
|
this.args.model.setCodesRemaining(this.remainingCodes);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.args.closeModal();
|
this.args.closeModal();
|
||||||
|
@ -68,6 +68,11 @@ export default Controller.extend(CanCheckEmails, {
|
|||||||
this.set("backupEnabled", value);
|
this.set("backupEnabled", value);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@action
|
||||||
|
setCodesRemaining(value) {
|
||||||
|
this.model.set("second_factor_remaining_backup_codes", value);
|
||||||
|
},
|
||||||
|
|
||||||
@action
|
@action
|
||||||
loadSecondFactors() {
|
loadSecondFactors() {
|
||||||
if (this.dirty === false) {
|
if (this.dirty === false) {
|
||||||
@ -322,6 +327,7 @@ export default Controller.extend(CanCheckEmails, {
|
|||||||
markDirty: () => this.markDirty(),
|
markDirty: () => this.markDirty(),
|
||||||
onError: (e) => this.handleError(e),
|
onError: (e) => this.handleError(e),
|
||||||
setBackupEnabled: (e) => this.setBackupEnabled(e),
|
setBackupEnabled: (e) => this.setBackupEnabled(e),
|
||||||
|
setCodesRemaining: (e) => this.setCodesRemaining(e),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user