mirror of
https://github.com/fosrl/pangolin.git
synced 2026-09-22 18:43:15 +02:00
Merge pull request #3599 from shleeable/patch-13
Typo: Update verifyApiKeyAccess to use generated apiKey.apiKeyOrg?.orgId data
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user