diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-10-04 21:46:55 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-10-04 21:46:55 +0530 |
commit | e7c9922d36ea82a54579c1f9e6633d4ad7ad3e74 (patch) | |
tree | ead331ad3804f831dd9c2bfabf63b9fb34971f6c /src/router/index.ts | |
parent | 92fb85b8afaacc4a8b5dbb41eea2d0e35eeb6862 (diff) |
added login and token refreshing
Diffstat (limited to 'src/router/index.ts')
-rw-r--r-- | src/router/index.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/router/index.ts b/src/router/index.ts index af8e2c5..568bad8 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -64,8 +64,8 @@ const router = createRouter({ }) router.beforeEach((to, _, next) => { - if (to.meta.isAuth && !localStorage.getItem("authToken")) { - next("/login?redirected=true") + if (to.meta.isAuth && !localStorage.getItem('authToken')) { + next('/login?redirected=true') } else { next() } |