feat(lst): tan stack routes added with protected routes
This commit is contained in:
12
frontend/src/routes/_auth.tsx
Normal file
12
frontend/src/routes/_auth.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import {createFileRoute, redirect} from "@tanstack/react-router";
|
||||
|
||||
// src/routes/_authenticated.tsx
|
||||
export const Route = createFileRoute("/_auth")({
|
||||
beforeLoad: async ({context}) => {
|
||||
if (!context.sessionType.session) {
|
||||
throw redirect({
|
||||
to: "/",
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user