From ccc5e67948232804953e713c51371b5610dce284 Mon Sep 17 00:00:00 2001 From: Andrew Gundersen Date: Fri, 12 Feb 2021 10:39:42 -0600 Subject: [PATCH] fix event for login --- src/background/session.ts | 3 ++- src/router.ts | 12 ++++++------ src/views/login.vue | 4 ++-- src/views/register.vue | 4 ++-- src/views/splash.vue | 2 -- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/background/session.ts b/src/background/session.ts index 80a74aa..228f1cd 100644 --- a/src/background/session.ts +++ b/src/background/session.ts @@ -35,12 +35,13 @@ const authSession = async (_event, payload: string | UserCreds | null): Promise< console.log('authenticating...'); - backgroundMitt.on('auth-res', (res: string) => { + backgroundMitt.once('auth-res', (res: string) => { if (res === 'locked') { reject(res); } else { auth = true; + console.log(res); resolve(res); } diff --git a/src/router.ts b/src/router.ts index eedf589..ea74f4e 100644 --- a/src/router.ts +++ b/src/router.ts @@ -12,16 +12,16 @@ import { useAuth } from '@/modules/auth'; const routes: Array = [ { path: "/", - name: "splash", - component: Splash, - meta: { requiresAuth: false }, - }, - { - path: "/home", name: "home", component: Home, meta: { requiresAuth: true }, }, + { + path: "/splash", + name: "splash", + component: Splash, + meta: { requiresAuth: false }, + }, { path: "/login", name: "login", diff --git a/src/views/login.vue b/src/views/login.vue index d63851a..5508f00 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -18,10 +18,10 @@ --> - + - + diff --git a/src/views/register.vue b/src/views/register.vue index 53cb9f8..6963d30 100644 --- a/src/views/register.vue +++ b/src/views/register.vue @@ -18,10 +18,10 @@ - + - + diff --git a/src/views/splash.vue b/src/views/splash.vue index 1db66eb..cb47283 100644 --- a/src/views/splash.vue +++ b/src/views/splash.vue @@ -47,12 +47,10 @@