v4.6.6-fix (#676)
This commit is contained in:
@@ -11,7 +11,7 @@ export async function authOpenApiKey({ apikey }: { apikey: string }) {
|
||||
return Promise.reject(ERROR_ENUM.unAuthApiKey);
|
||||
}
|
||||
try {
|
||||
const openApi = await MongoOpenApi.findOne({ apiKey: apikey });
|
||||
const openApi = await MongoOpenApi.findOne({ apiKey: apikey.trim() });
|
||||
if (!openApi) {
|
||||
return Promise.reject(ERROR_ENUM.unAuthApiKey);
|
||||
}
|
||||
|
||||
@@ -116,8 +116,7 @@ export async function authDatasetCollection({
|
||||
return Promise.reject(DatasetErrEnum.unAuthDatasetCollection);
|
||||
}
|
||||
|
||||
const isOwner =
|
||||
String(collection.datasetId.tmbId) === tmbId || role === TeamMemberRoleEnum.owner;
|
||||
const isOwner = String(collection.tmbId) === tmbId || role === TeamMemberRoleEnum.owner;
|
||||
const canWrite =
|
||||
isOwner ||
|
||||
(role !== TeamMemberRoleEnum.visitor &&
|
||||
|
||||
Reference in New Issue
Block a user