Skip to content

Commit

Permalink
Update router-auth.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrey-dot-li authored Aug 29, 2020
1 parent 090bac2 commit 5c662b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/router-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'))) {
Expand Down

0 comments on commit 5c662b9

Please sign in to comment.