diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-12-07 16:43:22 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2023-12-07 16:43:22 +0530 |
commit | b962a21b15e3d80d4d2132df76ca31bc41eb2fc9 (patch) | |
tree | ce40c6184f4c1e08d6a2712a1e45c89794ef6268 /src/router/index.ts | |
parent | 33ae84aea901c6737eb10b4e283d5de09c769512 (diff) |
redirecting after login0.4.1
Diffstat (limited to 'src/router/index.ts')
-rw-r--r-- | src/router/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/router/index.ts b/src/router/index.ts index 496f5d0..32a2962 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -85,8 +85,9 @@ const router = createRouter({ }) router.beforeEach((to, _, next) => { + console.log(to.fullPath) if (to.meta.isAuth && !localStorage.getItem('authToken')) { - next('/login?redirected=true') + next(`/login?redirect=${to.fullPath}`) } else { next() } |