From a5e2b4a31f57d32a6b9bcfe516826e7f3896d182 Mon Sep 17 00:00:00 2001 From: Daan Wijns Date: Wed, 17 Feb 2021 08:30:19 +0100 Subject: [PATCH] chore: cleanup route check --- src/App.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/App.vue b/src/App.vue index 4bea696d..b8c39934 100644 --- a/src/App.vue +++ b/src/App.vue @@ -29,6 +29,9 @@ export default { ...mapGetters(['getAuthenticated']), isAuthenticated() { return this.getAuthenticated() + }, + onLoginPage() { + return this.$router.currentRoute.name.includes('login') } }, created() { @@ -42,10 +45,7 @@ export default { const authenticated = res === 'Ok.' this.$store.commit('LOGIN', authenticated) this.$store.commit('updateMainData') - if ( - !authenticated && - !this.$router.currentRoute.name.includes('login') - ) this.$router.push('login') + if (!authenticated && !this.onLoginPage) return this.$router.push('login') }, checkDeviceDarkTheme() { if (this.webuiSettings.useDeviceDarkMode) {