mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-26 10:18:34 +02:00
fix: dont refetch every navigate
This commit is contained in:
@@ -2,7 +2,8 @@ import { createFileRoute, Outlet, redirect } from "@tanstack/react-router"
|
||||
|
||||
export const Route = createFileRoute("/_layout/_pages/_protected")({
|
||||
beforeLoad: ({ context, location, cause }) => {
|
||||
if (!context?.user?.userId) {
|
||||
if (cause === "stay") return
|
||||
if (!context?.auth?.userId) {
|
||||
throw redirect({
|
||||
to: "/sign-in/$",
|
||||
search: { redirect_url: location.pathname },
|
||||
|
||||
Reference in New Issue
Block a user