From 8f84594e9274b6bbbd7e36f285e464801b2f87fd Mon Sep 17 00:00:00 2001 From: kolaente Date: Fri, 30 Jul 2021 12:23:31 +0200 Subject: [PATCH] TOTP UX improvements & translation fixes --- src/i18n/lang/en.json | 2 +- src/views/user/Login.vue | 7 +++++++ src/views/user/PasswordReset.vue | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index a70c28ab..161edaf1 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -28,7 +28,7 @@ "passwordPlaceholder": "e.g. •••••••••••", "resetPassword": "Reset your password", "resetPasswordAction": "Send me a password reset link", - "restPasswordSuccess": "Check your inbox! You should have an e-mail with instructions on how to reset your password.", + "resetPasswordSuccess": "Check your inbox! You should have an e-mail with instructions on how to reset your password.", "passwordsDontMatch": "Passwords don't match", "confirmEmailSuccess": "You successfully confirmed your email! You can log in now.", "totpTitle": "Two Factor Authentication Code", diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 6bf6f6bb..547041ec 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -184,7 +184,14 @@ export default { } this.$store.dispatch('auth/login', credentials) + .then(() => { + this.$store.commit('auth/needsTotpPasscode', false) + }) .catch(e => { + if (e.response && e.response.data.code === 1017 && !credentials.totpPasscode) { + return + } + const err = getErrorText(e, p => this.$t(p)) if (typeof err[1] !== 'undefined') { this.$store.commit(ERROR_MESSAGE, err[1]) diff --git a/src/views/user/PasswordReset.vue b/src/views/user/PasswordReset.vue index 12e4497d..7a697bf5 100644 --- a/src/views/user/PasswordReset.vue +++ b/src/views/user/PasswordReset.vue @@ -39,7 +39,7 @@ :loading="this.passwordResetService.loading" @click="submit" > - {{ $t('user.auth.resetPassoword') }} + {{ $t('user.auth.resetPassword') }}