From fa158cb11ead071db3da90d8429f8bc9ea7022d5 Mon Sep 17 00:00:00 2001 From: saltbo Date: Sun, 2 Aug 2026 15:43:01 -0400 Subject: [PATCH] fix(oauth): log agent assertion verification failures --- server/auth/oauth-provider.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/auth/oauth-provider.ts b/server/auth/oauth-provider.ts index 661d43f1..7dbb7e12 100644 --- a/server/auth/oauth-provider.ts +++ b/server/auth/oauth-provider.ts @@ -256,7 +256,11 @@ async function verifyAgentAssertion( let verified: Awaited> try { verified = await jwtVerify(assertion, jwks, { audience: endpoint, maxTokenAge: '5m' }) - } catch { + } catch (error) { + console.warn('Agent assertion verification failed', { + code: error instanceof Error && 'code' in error ? error.code : undefined, + message: error instanceof Error ? error.message : String(error), + }) throw oauthError('invalid_grant', 'Agent assertion is invalid') } const issuer = requiredClaim(verified.payload.iss, 'assertion iss')