refactor: outsource auth function in all routes
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { LoginCard } from "../components/LoginCard";
|
||||
import { checkLogin } from "../utils/api/auth.ts";
|
||||
|
||||
export const Route = createFileRoute("/login")({
|
||||
beforeLoad: async () => {
|
||||
await checkLogin();
|
||||
},
|
||||
component: RouteComponent,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user