-
+
minmon
-
diff --git a/apps/web/src/components/sign-in-form.tsx b/apps/web/src/components/sign-in-form.tsx
index 2c3060e..119a020 100644
--- a/apps/web/src/components/sign-in-form.tsx
+++ b/apps/web/src/components/sign-in-form.tsx
@@ -129,8 +129,8 @@ export default function SignInForm() {
Student demo flow uses administrator sign-in only.
-
- Return to homepage
+
+ Open dashboard after sign in
diff --git a/apps/web/src/routes/index.tsx b/apps/web/src/routes/index.tsx
index 4ba9b8f..1ef3955 100644
--- a/apps/web/src/routes/index.tsx
+++ b/apps/web/src/routes/index.tsx
@@ -1,51 +1,14 @@
-import { useQuery } from "@tanstack/react-query";
-import { createFileRoute } from "@tanstack/react-router";
+import { createFileRoute, redirect } from "@tanstack/react-router";
-import { trpc } from "@/utils/trpc";
+import { authClient } from "@/lib/auth-client";
export const Route = createFileRoute("/")({
- component: HomeComponent,
+ beforeLoad: async () => {
+ const session = await authClient.getSession();
+
+ throw redirect({
+ to: session.data ? "/dashboard" : "/login",
+ });
+ },
+ component: () => null,
});
-
-const TITLE_TEXT = `
- ██████╗ ███████╗████████╗████████╗███████╗██████╗
- ██╔══██╗██╔════╝╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗
- ██████╔╝█████╗ ██║ ██║ █████╗ ██████╔╝
- ██╔══██╗██╔══╝ ██║ ██║ ██╔══╝ ██╔══██╗
- ██████╔╝███████╗ ██║ ██║ ███████╗██║ ██║
- ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
-
- ████████╗ ███████╗████████╗ █████╗ ██████╗██╗ ██╗
- ╚══██╔══╝ ██╔════╝╚══██╔══╝██╔══██╗██╔════╝██║ ██╔╝
- ██║ ███████╗ ██║ ███████║██║ █████╔╝
- ██║ ╚════██║ ██║ ██╔══██║██║ ██╔═██╗
- ██║ ███████║ ██║ ██║ ██║╚██████╗██║ ██╗
- ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
- `;
-
-function HomeComponent() {
- const healthCheck = useQuery(trpc.healthCheck.queryOptions());
-
- return (
-
-
{TITLE_TEXT}
-
-
- API Status
-
-
-
- {healthCheck.isLoading
- ? "Checking..."
- : healthCheck.data
- ? "Connected"
- : "Disconnected"}
-
-
-
-
-
- );
-}