debug(encryptid): add OIDC token exchange debug logging

Temporary logging to diagnose invalid_grant errors on token exchange.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-03-10 13:19:32 -07:00
parent 61c735cabd
commit 6d0ebf2958
1 changed files with 3 additions and 0 deletions

View File

@ -5361,12 +5361,15 @@ app.post('/oidc/token', async (c) => {
// Consume auth code (atomic — marks used)
const authCode = await consumeOidcAuthCode(code);
if (!authCode) {
console.log('OIDC token: auth code not found or already used');
return c.json({ error: 'invalid_grant' }, 400);
}
if (authCode.clientId !== clientId) {
console.log(`OIDC token: clientId mismatch: code=${authCode.clientId} req=${clientId}`);
return c.json({ error: 'invalid_grant' }, 400);
}
if (authCode.redirectUri !== redirectUri) {
console.log(`OIDC token: redirectUri mismatch: code=${authCode.redirectUri} req=${redirectUri}`);
return c.json({ error: 'invalid_grant' }, 400);
}