Fixup password reset view

This commit is contained in:
Johannes Zellner
2025-03-25 18:05:29 +01:00
parent d8373bc488
commit 0cffd76296
6 changed files with 144 additions and 121 deletions
+7 -2
View File
@@ -170,16 +170,18 @@ async function onRevokeAllWebAndCliTokens() {
// 2fa
const mandatory2FAHelp = ref('');
const twoFAModal = ref(false);
const twoFASecret = ref('');
const twoFATotpToken = ref('');
const twoFAQRCode = ref('');
const twoFAEnableError = ref('');
const twoFADialog = useTemplateRef('twoFADialog');
async function onOpenTwoFASetupDialog() {
async function onOpenTwoFASetupDialog(modal = false) {
const [error, result] = await profileModel.setTwoFASecret();
if (error) return console.error(error);
twoFAModal.value = modal;
twoFAEnableError.value = '';
twoFATotpToken.value = '';
twoFASecret.value = result.secret;
@@ -244,6 +246,9 @@ onMounted(async () => {
// dashboard and development clientIds were issued with 7.5.0
webadminTokens.value = result.filter(function (c) { return c.clientId === TOKEN_TYPES.ID_WEBADMIN || c.clientId === TOKEN_TYPES.ID_DEVELOPMENT || c.clientId === 'dashboard' || c.clientId === 'development'; });
cliTokens.value = result.filter(function (c) { return c.clientId === TOKEN_TYPES.ID_CLI; });
// check if we should show the 2fa setup
if (window.location.hash.indexOf('setup2fa') !== -1) onOpenTwoFASetupDialog(true /* modal */);
});
</script>
@@ -251,7 +256,7 @@ onMounted(async () => {
<template>
<InputDialog ref="inputDialog" />
<Dialog ref="twoFADialog" :title="$t('profile.enable2FA.title')" :show-x="true">
<Dialog ref="twoFADialog" :title="$t('profile.enable2FA.title')" :show-x="!twoFAModal" :modal="twoFAModal">
<div style="text-align: center; max-width: 420px">
<p v-show="mandatory2FAHelp">{{ $t('profile.enable2FA.description') }}</p>
<p v-html="$t('profile.enable2FA.authenticatorAppDescription', { googleAuthenticatorPlayStoreLink: 'https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2', googleAuthenticatorITunesLink: 'https://itunes.apple.com/us/app/google-authenticator/id388497605', freeOTPPlayStoreLink: 'https://play.google.com/store/apps/details?id=org.fedorahosted.freeotp', freeOTPITunesLink: 'https://itunes.apple.com/us/app/freeotp-authenticator/id872559395'})"></p>