Merge pull request #3599 from shleeable/patch-13

Typo: Update verifyApiKeyAccess to use generated apiKey.apiKeyOrg?.orgId data
This commit is contained in:
Owen Schwartz
2026-09-21 14:36:38 -04:00
committed by GitHub
+3 -8
View File
@@ -70,13 +70,8 @@ export async function verifyApiKeyAccess(
);
}
if (!apiKeyOrg.orgId) {
return next(
createHttpError(
HttpCode.INTERNAL_SERVER_ERROR,
`API key with ID ${apiKeyId} does not have an organization ID`
)
);
if (!apiKey.apiKeyOrg?.orgId) {
return next(createHttpError(HttpCode.INTERNAL_SERVER_ERROR, `API key with ID ${apiKeyId} does not have an organization ID`));
}
if (!req.userOrg) {
@@ -86,7 +81,7 @@ export async function verifyApiKeyAccess(
.where(
and(
eq(userOrgs.userId, userId),
eq(userOrgs.orgId, apiKeyOrg.orgId)
eq(userOrgs.orgId, apiKey.apiKeyOrg.orgId)
)
)
.limit(1);