From 0b0b8d7fd35b0516df4b2d61008d6843c3ad48ec Mon Sep 17 00:00:00 2001 From: Haris Razis Date: Tue, 5 Jan 2021 11:54:15 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Move=20auto=20login=20to=20login?= =?UTF-8?q?=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/Home.vue | 11 ----------- web/src/views/Login.vue | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/web/src/views/Home.vue b/web/src/views/Home.vue index 662fce9..22740f3 100644 --- a/web/src/views/Home.vue +++ b/web/src/views/Home.vue @@ -48,16 +48,5 @@ import ShapeDividerTop from '@/components/ShapeDividerTop.vue'; }) export default class Home extends Vue { - mounted() { - this.getCurrentUser(); - } - - private getCurrentUser() { - this.$store.dispatch('getCurrentUser') - .then(() => this.$router.push('/dashboard')) - .catch((err: any) => { - this.$router.push('/') - }) - } } diff --git a/web/src/views/Login.vue b/web/src/views/Login.vue index 2e23659..a884a5b 100644 --- a/web/src/views/Login.vue +++ b/web/src/views/Login.vue @@ -55,6 +55,18 @@ export default class Login extends Vue { private username = ''; private password = ''; + mounted() { + this.getCurrentUser(); + } + + private getCurrentUser() { + this.$store.dispatch('getCurrentUser') + .then(() => this.$router.push('/dashboard')) + .catch((err: any) => { + this.$router.push('/') + }) + } + private login() { let user = {username: this.username, password: this.password}