You've already forked agentic-coding-workflow
fix(web): preserve next on 401, validate redirect target, catch navigation rejections
This commit is contained in:
@@ -7,13 +7,12 @@ const routes: RouteRecordRaw[] = [
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: () => import('@/views/auth/LoginView.vue'),
|
||||
meta: { layout: 'none' },
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
name: 'home',
|
||||
component: () => import('@/views/HomeView.vue'),
|
||||
meta: { layout: 'app', requiresAuth: true },
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
]
|
||||
|
||||
@@ -42,7 +41,9 @@ export function bindAuthToApi() {
|
||||
tokenProvider: () => auth.token,
|
||||
onUnauthorized: () => {
|
||||
auth.clearSession()
|
||||
router.replace({ name: 'login' })
|
||||
const current = router.currentRoute.value
|
||||
const query = current.name === 'login' ? undefined : { next: current.fullPath }
|
||||
router.replace({ name: 'login', query }).catch(() => {})
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user