diff --git a/frontend/src/views/Pages/ResetPassword.spec.js b/frontend/src/views/Pages/ResetPassword.spec.js index f3bbc7334..e28d16c3e 100644 --- a/frontend/src/views/Pages/ResetPassword.spec.js +++ b/frontend/src/views/Pages/ResetPassword.spec.js @@ -28,6 +28,9 @@ const createMockObject = (comingFrom) => { optin: '123', comingFrom, }, + path: { + includes: (t) => t, + }, }, $toasted: { global: { diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index 3e6aef339..05d8a0f6e 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -5,10 +5,10 @@
-

{{ $t('settings.password.reset') }}

+

{{ $t(displaySetup.authenticated) }}

- {{ $t('settings.password.reset-password.text') }} + {{ $t(displaySetup.notAuthenticated) }}
@@ -49,14 +49,14 @@ import { setPassword } from '../../graphql/mutations' const textFields = { reset: { - authenticated: 'settings.password.reset-password.text', - notAuthenticated: 'settings.password.not-authenticated', - button: 'settings.password.reset', + authenticated: 'settings.password.change-password', + notAuthenticated: 'settings.password.reset-password.text', + button: 'settings.password.change-password', linkTo: '/login', }, checkEmail: { - authenticated: 'settings.password.set-password.text', - notAuthenticated: 'settings.password.not-authenticated', + authenticated: 'settings.password.set', + notAuthenticated: 'settings.password.set-password.text', button: 'settings.password.set', linkTo: '/login', }, @@ -95,19 +95,17 @@ export default { this.$router.push('/thx/reset') }) .catch((error) => { - if (error.message.includes('Code is older than 10 minutes')) { - this.$toasted.global.error(error.message) + this.$toasted.global.error(error.message) + if (error.message.includes('Code is older than 10 minutes')) this.$router.push('/password/reset') - } else { - this.$toasted.global.error(error.message) - } }) }, setDisplaySetup() { - if (!this.$route.params.comingFrom) { + if (this.$route.path.includes('checkEmail')) { + this.displaySetup = textFields.checkEmail + } + if (this.$route.path.includes('reset')) { this.displaySetup = textFields.reset - } else { - this.displaySetup = textFields[this.$route.params.comingFrom] } }, },