Case where a user has not activated his email he gets redirected to /thx/login with a message to check his eamils.

This commit is contained in:
elweyn 2021-12-07 10:14:52 +01:00
parent 00f08ff2db
commit 03faac6ecb
3 changed files with 3 additions and 4 deletions

View File

@ -50,7 +50,7 @@ const routes = [
path: '/thx/:comingFrom', path: '/thx/:comingFrom',
component: () => import('../views/Pages/thx.vue'), component: () => import('../views/Pages/thx.vue'),
beforeEnter: (to, from, next) => { beforeEnter: (to, from, next) => {
const validFrom = ['password', 'reset', 'register', 'login'] const validFrom = ['password', 'reset', 'register', 'login', 'Login']
if (!validFrom.includes(from.path.split('/')[1])) { if (!validFrom.includes(from.path.split('/')[1])) {
next({ path: '/login' }) next({ path: '/login' })
} else { } else {

View File

@ -88,7 +88,6 @@ export default {
}, },
}, },
created() { created() {
console.log('comingFrom', this.$route.params.comingFrom)
if (this.$route.params.comingFrom) { if (this.$route.params.comingFrom) {
this.displaySetup = textFields[this.$route.params.comingFrom] this.displaySetup = textFields[this.$route.params.comingFrom]
} else { } else {

View File

@ -105,11 +105,11 @@ export default {
loader.hide() loader.hide()
}) })
.catch((error) => { .catch((error) => {
if (!error.message.includes('user email not validated')) { if (!error.message.includes('User email not validated')) {
this.$toasted.error(this.$t('error.no-account')) this.$toasted.error(this.$t('error.no-account'))
} else { } else {
// : this.$t('error.no-email-verify') // : this.$t('error.no-email-verify')
this.$router.push('/thx/login') this.$router.push('/reset/login')
} }
loader.hide() loader.hide()
}) })