From 6d2fd792091aac9ae5b6332fb5d4a10d5fe8a565 Mon Sep 17 00:00:00 2001 From: Lucas Berger Date: Tue, 9 Jun 2026 10:44:15 -0400 Subject: [PATCH] fix(03): IN-04 type resolveUserId param as Hono Context instead of any --- apps/api/src/routes/events.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/api/src/routes/events.ts b/apps/api/src/routes/events.ts index e85c19c..0920705 100644 --- a/apps/api/src/routes/events.ts +++ b/apps/api/src/routes/events.ts @@ -23,6 +23,7 @@ import { randomUUID } from 'node:crypto' import { Hono } from 'hono' +import type { Context } from 'hono' import { zValidator } from '@hono/zod-validator' import { z } from 'zod' import { and, or, eq, desc } from 'drizzle-orm' @@ -55,8 +56,10 @@ const MAX_WINDOW_DAYS = 90 // Identity is keyed on oidc_iss + oidc_sub (D-10), never email. // 3. Callers emit 401 when resolveUserId returns null. // -// eslint-disable-next-line @typescript-eslint/no-explicit-any -async function resolveUserId(c: any): Promise { +// IN-04: typed as Hono's Context instead of `any`. c.get('user') resolves through the +// ContextVariableMap augmentation in auth/devBypass.ts (typed as the DEV_USER shape), +// and getAuth(c) accepts a Context — so no `any` / eslint-disable is needed here. +async function resolveUserId(c: Context): Promise { const devUser = c.get('user') as { id: number } | undefined if (devUser) return devUser.id