fix: replace to invalidate context

This commit is contained in:
Aslam H
2024-10-30 05:40:38 +07:00
parent fcffba23f1
commit 5294ade0ab
7 changed files with 20 additions and 9 deletions

View File

@@ -2,7 +2,7 @@ import { createFileRoute, Outlet, redirect } from "@tanstack/react-router"
export const Route = createFileRoute("/_layout/(auth)/_auth")({
beforeLoad({ context }) {
if (context.auth.userId) {
if (context.auth?.userId) {
throw redirect({ to: "/links", replace: true })
}
},