From b962a21b15e3d80d4d2132df76ca31bc41eb2fc9 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Thu, 7 Dec 2023 16:43:22 +0530 Subject: redirecting after login --- src/router/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/router/index.ts') 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() } -- cgit v1.2.3