v2026.10.1: keep login redirect, show wrong-password error

The axios 401 interceptor treated failed auth calls (the guard's own
/api/auth/refresh, a wrong-password /api/auth/login) as an expired session
and hard-navigated to a bare /login. That dropped the router guard's
?redirect= and reloaded the login page before its error could show.

- Skip auto-refresh for login/register/refresh
- On a real mid-use expiry, redirect to /login?redirect=<current path>
- LoginView only follows in-app redirect paths

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
derekcandClaude Opus 5.5 committed 2026-10-12 23:10:04 -07:00
1 parent 954161ba8f
commit 3460fff8ff
5 files changed
+26 -8

No files matched your search

+4 -2
View File
@@ -57,8 +57,10 @@ async function submit() {
} else {
await auth.register(form.value.email, form.value.password, form.value.fullName)
}
const redirect = route.query.redirect || '/dashboard'
router.push(redirect)
// Only follow in-app paths ("//host" would be protocol-relative)
const redirect = route.query.redirect
const safe = typeof redirect === 'string' && redirect.startsWith('/') && !redirect.startsWith('//')
router.push(safe ? redirect : '/dashboard')
} catch (e) {
error.value = e.response?.data?.detail || 'Something went wrong'
} finally {