mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
chore: temp solution for fetching clerk on every navigated
This commit is contained in:
@@ -2,13 +2,11 @@ import { createFileRoute, Outlet, redirect } from "@tanstack/react-router"
|
||||
|
||||
export const Route = createFileRoute("/_layout/_pages/_protected")({
|
||||
beforeLoad: ({ context, location, cause }) => {
|
||||
if (cause !== "stay") {
|
||||
if (!context?.user?.userId) {
|
||||
throw redirect({
|
||||
to: "/sign-in/$",
|
||||
search: { redirect_url: location.pathname },
|
||||
})
|
||||
}
|
||||
if (!context?.user?.userId) {
|
||||
throw redirect({
|
||||
to: "/sign-in/$",
|
||||
search: { redirect_url: location.pathname },
|
||||
})
|
||||
}
|
||||
},
|
||||
component: () => <Outlet />,
|
||||
|
||||
Reference in New Issue
Block a user