Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

feat: add index route with auth guard and redirect logic

Shine1ifc71548a3118
diff --git a/studio/frontend/src/app/router.tsx b/studio/frontend/src/app/router.tsx
index de8564d035a..63ae4e201ca 100644
--- a/studio/frontend/src/app/router.tsx
+++ b/studio/frontend/src/app/router.tsx
@@ -2,6 +2,7 @@ import { createRouter } from "@tanstack/react-router";
import { Route as rootRoute } from "./routes/__root";
import { Route as chatRoute } from "./routes/chat";
import { Route as gridTestRoute } from "./routes/grid-test";
+import { Route as indexRoute } from "./routes/index";
import { Route as loginRoute } from "./routes/login";
import { Route as onboardingRoute } from "./routes/onboarding";
import { Route as exportRoute } from "./routes/export";
@@ -9,6 +10,7 @@ import { Route as signupRoute } from "./routes/signup";
import { Route as studioRoute } from "./routes/studio";
const routeTree = rootRoute.addChildren([
+ indexRoute,
onboardingRoute,
loginRoute,
signupRoute,
diff --git a/studio/frontend/src/app/routes/index.tsx b/studio/frontend/src/app/routes/index.tsx
new file mode 100644
index 00000000000..4ce567fbec5
--- /dev/null
+++ b/studio/frontend/src/app/routes/index.tsx
@@ -0,0 +1,14 @@
+import { createRoute, redirect } from "@tanstack/react-router";
+import { getPostAuthRoute } from "@/features/auth";
+import { requireAuth } from "../auth-guards";
+import { Route as rootRoute } from "./__root";
+
+export const Route = createRoute({
+ getParentRoute: () => rootRoute,
+ path: "/",
+ beforeLoad: async () => {
+ await requireAuth();
+ throw redirect({ to: getPostAuthRoute() });
+ },
+ component: () => null,
+});