update
Some checks failed
Deploy / deploy (push) Failing after 4m2s

This commit is contained in:
Никита Круглицкий
2025-10-09 22:29:42 +06:00
parent 6ada2c3fbd
commit bb48e52a99
14 changed files with 1234 additions and 15 deletions

15
server/trpc/router.ts Normal file
View File

@@ -0,0 +1,15 @@
import type { Context } from './context'
import { initTRPC } from '@trpc/server'
const t = initTRPC.context<Context>().create()
export const router = t.router
export const publicProcedure = t.procedure
export const protectedProcedure = t.procedure.use(({ ctx, next }) => {
if (!ctx.session?.fresh)
throw new Error('UNAUTHORIZED')
return next({ ctx: { ...ctx } })
})