From 0dc4e6b95df462164e1acb36693baf3f14dbc5a5 Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 12 May 2020 15:08:17 +0200 Subject: [PATCH] Fix trying to load the current tasks even when not logged in (Fixes #133) --- src/App.vue | 6 ++++++ src/components/Home.vue | 15 ++++++--------- src/components/tasks/ShowTasksInRange.vue | 9 +++++++-- src/main.js | 4 ---- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/App.vue b/src/App.vue index 61f013753..b1818ca5f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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') diff --git a/src/components/Home.vue b/src/components/Home.vue index b16d821f6..0b59a7937 100644 --- a/src/components/Home.vue +++ b/src/components/Home.vue @@ -9,16 +9,19 @@ > Import your data into Vikunja - +