chore: fix formatting and add auth guards to dashboard route

This commit is contained in:
bipproduction
2026-02-09 15:01:33 +08:00
parent c4de7e4e62
commit 1f03927987
2 changed files with 28 additions and 7 deletions

View File

@@ -31,11 +31,17 @@ import {
} from "@tanstack/react-router";
import { useSnapshot } from "valtio";
import { ColorSchemeToggle } from "@/components/ColorSchemeToggle";
import { protectedRouteMiddleware } from "@/middleware/authMiddleware";
import { authClient } from "@/utils/auth-client";
import { authStore } from "../../store/auth";
export const Route = createFileRoute("/dashboard")({
component: DashboardLayout,
beforeLoad: protectedRouteMiddleware,
onEnter({ context }) {
authStore.user = context?.user as any;
authStore.session = context?.session as any;
},
});
function DashboardLayout() {