partial: user routes

This commit is contained in:
DecDuck
2025-08-10 10:19:45 +10:00
parent 80f7757558
commit a0b4381f0b
54 changed files with 545 additions and 410 deletions

View File

@ -17,7 +17,9 @@ type ClientUtils = {
const NONCE_LENIENCE = 30_000;
export function defineClientEventHandler<T>(handler: EventHandlerFunction<T>) {
export function defineClientEventHandler<R extends EventHandlerRequest = object, K = unknown>(
handler: (h3: H3Event<R>, utils: ClientUtils) => Promise<K> | K,
) {
return defineEventHandler(async (h3) => {
const header = getHeader(h3, "Authorization");
if (!header) throw createError({ statusCode: 403 });