🎉 initial commit

This commit is contained in:
2026-08-17 00:22:30 +02:00
parent cd04ebe254
commit 55a51a521d
19 changed files with 1645 additions and 35 deletions
+22
View File
@@ -0,0 +1,22 @@
import { createServerFn } from '@tanstack/react-start'
import { getRequest } from '@tanstack/react-start/server'
export 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()
if (!session) {
throw new Error('Not signed in')
}
return session
}
export const getCurrentStaffUser = createServerFn({ method: 'GET' }).handler(async () => {
const session = await getStaffSession()
return session?.user ?? null
})