forked from naskya/firefish
fix(frontend): allow disabling of 2fa when security key is registered
This commit is contained in:
parent
2c78c01d57
commit
437d02ef5d
1 changed files with 1 additions and 24 deletions
|
@ -14,17 +14,7 @@
|
|||
<template #caption>{{ i18n.ts.totpDescription }}</template>
|
||||
<div v-if="$i.twoFactorEnabled" class="_gaps_s">
|
||||
<div v-text="i18n.ts._2fa.alreadyRegistered" />
|
||||
<template v-if="$i.securityKeysList.length > 0">
|
||||
<MkButton @click="renewTOTP"
|
||||
><i
|
||||
:class="icon('ph-shield-check')"
|
||||
style="margin-inline-end: 0.5rem"
|
||||
></i
|
||||
>{{ i18n.ts._2fa.renewTOTP }}</MkButton
|
||||
>
|
||||
<MkInfo>{{ i18n.ts._2fa.whyTOTPOnlyRenew }}</MkInfo>
|
||||
</template>
|
||||
<MkButton v-else @click="unregisterTOTP"
|
||||
<MkButton @click="unregisterTOTP"
|
||||
><i
|
||||
:class="icon('ph-shield-slash')"
|
||||
style="margin-inline-end: 0.5rem"
|
||||
|
@ -198,19 +188,6 @@ function unregisterTOTP() {
|
|||
});
|
||||
}
|
||||
|
||||
function renewTOTP() {
|
||||
os.confirm({
|
||||
type: "question",
|
||||
title: i18n.ts._2fa.renewTOTP,
|
||||
text: i18n.ts._2fa.renewTOTPConfirm,
|
||||
okText: i18n.ts._2fa.renewTOTPOk,
|
||||
cancelText: i18n.ts._2fa.renewTOTPCancel,
|
||||
}).then(({ canceled }) => {
|
||||
if (canceled) return;
|
||||
registerTOTP();
|
||||
});
|
||||
}
|
||||
|
||||
async function unregisterKey(key) {
|
||||
const confirm = await os.confirm({
|
||||
type: "question",
|
||||
|
|
Loading…
Reference in a new issue