DUNGEONS-34: implement Webka local streaming app
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
12
frontend/middleware/auth.global.ts
Normal file
12
frontend/middleware/auth.global.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export default defineNuxtRouteMiddleware(async (to) => {
|
||||
if (to.path === "/login") return;
|
||||
const session = useSessionStore();
|
||||
if (!(await session.refresh())) return navigateTo("/login");
|
||||
if (
|
||||
(to.path === "/host" || to.path.startsWith("/settings/accounts")) &&
|
||||
session.user?.role !== "admin"
|
||||
)
|
||||
return navigateTo("/watch");
|
||||
if (to.path === "/")
|
||||
return navigateTo(session.user?.role === "admin" ? "/host" : "/watch");
|
||||
});
|
||||
Reference in New Issue
Block a user