fix: resolve all 13 remaining test failures
Some checks failed
CI / ci (push) Failing after 56s
CI / e2e (push) Has been skipped

- OAuth: add userId to oauth_codes schema and migration, derive userId
  from stored auth code/token record instead of passing separately
- Auth middleware tests: destructure {db, userId} from createTestDb,
  pass userId to createApiKey, fix error message assertion
- MCP tests: add missing await on getCollectionSummary and
  createSecondTestUser calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 20:25:41 +02:00
parent c0f9d5c4d0
commit 7dbbfcb915
6 changed files with 30 additions and 17 deletions

View File

@@ -202,9 +202,14 @@ oauthRoutes.post("/authorize", async (c) => {
return c.json({ error: "redirect_uri not allowed" }, 400);
}
// Get or create user from OIDC session
const { getOrCreateUser } = await import("../services/auth.service");
const user = await getOrCreateUser(db, auth.sub);
const { code } = await createAuthorizationCode(
db,
clientId,
user.id,
codeChallenge,
codeChallengeMethod,
redirectUri,