Fix trying to load the current tasks even when not logged in (Fixes #133)

This commit is contained in:
kolaente 2020-05-12 15:08:17 +02:00
parent cc46809639
commit 0dc4e6b95d
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
4 changed files with 19 additions and 15 deletions

View file

@ -265,6 +265,12 @@
router.push({name: 'login'})
}
},
beforeCreate() {
// Check if the user is already logged in, if so, redirect them to the homepage
if (!this.userAuthenticated && this.$route.name !== 'login') {
router.push({name: 'login'})
}
},
created() {
this.$store.dispatch('config/update')
this.$store.dispatch('auth/checkAuth')