mirror of
https://github.com/ZHANGTIANYAO1/teamspeak-music-bot.git
synced 2026-10-02 04:52:50 +08:00
feat(web/router): block guests from settings and setup routes
This commit is contained in:
1 parent
0c59a9f84a
commit
78cf516c4c
1 file changed
+6
@@ -58,6 +58,12 @@ router.beforeEach(async (to) => {
|
||||
return { name: 'login', query: { next: to.fullPath } };
|
||||
}
|
||||
|
||||
// Guests may never reach settings/setup, even by typing the URL.
|
||||
const GUEST_BLOCKED = new Set(['settings', 'setup']);
|
||||
if (session.isGuest.value && GUEST_BLOCKED.has(to.name as string)) {
|
||||
return { name: 'home' };
|
||||
}
|
||||
|
||||
// Navigation is allowed to proceed to `to` past here (auth/setup redirects above take precedence).
|
||||
// Sync + preserve the dedicated-link scope carried by ?bot.
|
||||
const store = usePlayerStore();
|
||||
|
||||
Reference in new issue
Block a user