mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-23 00:38:39 +02:00
chore: auth context
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { createFileRoute, Outlet, redirect } from "@tanstack/react-router"
|
||||
|
||||
export const Route = createFileRoute("/_layout/_pages/_protected")({
|
||||
beforeLoad: ({ context, location, cause }) => {
|
||||
if (cause === "stay") return
|
||||
beforeLoad: async ({ context, location, cause }) => {
|
||||
if (!context?.auth?.userId) {
|
||||
throw redirect({
|
||||
to: "/sign-in/$",
|
||||
|
||||
Reference in New Issue
Block a user