fix(auth): WS Origin host check + Login next-param open-redirect guard

This commit is contained in:
saopig1 committed 2026-05-27 14:02:33 +08:00
1 parent e148c1556e
commit a8b056d2aa
2 files changed
+17 -1

No files matched your search

+2 -1
View File
@@ -34,7 +34,8 @@ async function submit() {
loading.value = true;
try {
await session.login(username.value, password.value);
const next = typeof route.query.next === 'string' ? route.query.next : '/';
const rawNext = typeof route.query.next === 'string' ? route.query.next : '/';
const next = rawNext.startsWith('/') && !rawNext.startsWith('//') ? rawNext : '/';
router.replace(next);
} catch (e) {
error.value = (e as Error).message;