From f8d1d553dfa8342fcb55cf2227765e67b8400e5a Mon Sep 17 00:00:00 2001 From: Chesspro13 Date: Fri, 3 May 2024 15:22:19 -0700 Subject: [PATCH] Added regenerate totp button to the click event for enabling totp --- .../widgets/type_widgets/options/multi_factor_authentication.js | 1 + src/routes/api/totp.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/public/app/widgets/type_widgets/options/multi_factor_authentication.js b/src/public/app/widgets/type_widgets/options/multi_factor_authentication.js index c96fcd084..40643c0d4 100644 --- a/src/public/app/widgets/type_widgets/options/multi_factor_authentication.js +++ b/src/public/app/widgets/type_widgets/options/multi_factor_authentication.js @@ -101,6 +101,7 @@ export default class MultiFactorAuthenticationOptions extends OptionsWidget { this.$totpSecretInput.prop("disabled", !result.message); this.$saveTotpButton.prop("disabled", !result.message); this.$totpSecret.prop("disapbled", !result.message); + this.$regenerateTotpButton.prop("disabled", !result.message); } else { toastService.showError(result.message); } diff --git a/src/routes/api/totp.ts b/src/routes/api/totp.ts index 66ecf65c0..1e7506336 100644 --- a/src/routes/api/totp.ts +++ b/src/routes/api/totp.ts @@ -39,6 +39,7 @@ function disableTOTP() { } function setTotpSecret(req: Request) { + // TODO: CHECK VALIDITY OF SECRET options.setOption totp_fs.saveTotpSecret(req.body.secret) }