Fix redirecting for unauthenticated pages to login

This commit is contained in:
kolaente 2020-05-12 15:17:47 +02:00
parent 0dc4e6b95d
commit b876a4d4dc
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -267,7 +267,14 @@
}, },
beforeCreate() { beforeCreate() {
// Check if the user is already logged in, if so, redirect them to the homepage // Check if the user is already logged in, if so, redirect them to the homepage
if (!this.userAuthenticated && this.$route.name !== 'login') { if (
!this.userAuthenticated &&
this.$route.name !== 'login' &&
this.$route.name !== 'getPasswordReset' &&
this.$route.name !== 'passwordReset' &&
this.$route.name !== 'register' &&
this.$route.name !== 'linkShareAuth'
) {
router.push({name: 'login'}) router.push({name: 'login'})
} }
}, },