You've already forked agentic-coding-workflow
fix(web): preserve next on 401, validate redirect target, catch navigation rejections
This commit is contained in:
@@ -40,8 +40,10 @@ async function onSubmit() {
|
||||
try {
|
||||
const out = await authApi.login(email.value, password.value)
|
||||
auth.setSession(out.token, out.user)
|
||||
const next = (router.currentRoute.value.query.next as string) || '/'
|
||||
await router.replace(next)
|
||||
const raw = router.currentRoute.value.query.next
|
||||
const next =
|
||||
typeof raw === 'string' && raw.startsWith('/') && !raw.startsWith('//') ? raw : '/'
|
||||
await router.replace(next).catch(() => {})
|
||||
} catch (e) {
|
||||
error.value = e instanceof ApiException ? e.body.message : '登录失败'
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user