| ... | ... | @@ -1,7 +1,15 @@ |
| 1 | | import { createFileRoute } from "@tanstack/react-router"; |
| 1 | import { createFileRoute, redirect } from "@tanstack/react-router"; |
| 2 | 2 | |
| 3 | 3 | import { UsagePage } from "../components/usage/UsagePage"; |
| 4 | 4 | |
| 5 | 5 | export const Route = createFileRoute("/usage")({ |
| 6 | beforeLoad: async ({ context }) => { |
| 7 | if ( |
| 8 | context.authGateState.status !== "authenticated" && |
| 9 | context.authGateState.status !== "hosted-static" |
| 10 | ) { |
| 11 | throw redirect({ to: "/pair", replace: true }); |
| 12 | } |
| 13 | }, |
| 6 | 14 | component: UsagePage, |
| 7 | 15 | }); |