| 1 | import { createFileRoute, redirect } from "@tanstack/react-router"; |
| 2 | |
| 3 | import { UsagePage } from "../components/usage/UsagePage"; |
| 4 | |
| 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 | }, |
| 14 | component: UsagePage, |
| 15 | }); |