wip
CI / build-and-test (push) Failing after 55s

This commit is contained in:
2026-08-25 11:55:17 +02:00
parent 55a51a521d
commit 8309f937ed
36 changed files with 5024 additions and 275 deletions
+8 -3
View File
@@ -1,10 +1,15 @@
import { createServerFn } from '@tanstack/react-start'
import { createServerFn, createServerOnlyFn } from '@tanstack/react-start'
import { getRequest } from '@tanstack/react-start/server'
export async function getStaffSession() {
// `staff.index.tsx` and friends import `getCurrentStaffUser` from this module for
// their `beforeLoad` checks, which pulls the whole file into the client bundle too.
// `createServerOnlyFn` tells the compiler this closure (and the server-only
// `getRequest` import it uses) can be stripped from that client bundle instead of
// dragging the Postgres driver into the browser.
export const getStaffSession = createServerOnlyFn(async function getStaffSession() {
const { getAuth } = await import('#/lib/auth-instance')
return getAuth().api.getSession({ headers: getRequest().headers })
}
})
export async function requireStaffSession() {
const session = await getStaffSession()