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 ++- src/views/LogIn.vue | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src') 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() } diff --git a/src/views/LogIn.vue b/src/views/LogIn.vue index 1b5f6c9..415c562 100644 --- a/src/views/LogIn.vue +++ b/src/views/LogIn.vue @@ -1,6 +1,6 @@