mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-01 20:42:50 +08:00
fix(auth): WS Origin host check + Login next-param open-redirect guard
This commit is contained in:
1 parent
e148c1556e
commit
a8b056d2aa
2 files changed
+17
-1
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user