From 5c662b9e048243184aa9e1fd782b439f1a2f1b8f Mon Sep 17 00:00:00 2001 From: Jeffrey Li <46302202+DrCheddar@users.noreply.github.com> Date: Sat, 29 Aug 2020 16:25:23 -0400 Subject: [PATCH] Update router-auth.ts --- middleware/router-auth.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware/router-auth.ts b/middleware/router-auth.ts index a1c08be..2fcd5b6 100644 --- a/middleware/router-auth.ts +++ b/middleware/router-auth.ts @@ -7,7 +7,7 @@ export default function ({ store, redirect, route }: Context) { const validUser = (store.state.auth.user != null && store.state.auth.user.emailVerified) console.log(route.name); if (route.name == "index") { - return validUser ? redirect("/splash") : redirect("/home"); + return !validUser ? redirect("/splash") : redirect("/home"); } if ((validUser) && (route.name == null || route?.name?.split('/').some(record => record == 'auth'))) {