fix: add only credentials object when credentials are present

This commit is contained in:
Christian Capeans 2023-11-13 19:54:47 +01:00
parent d87a9b3b6b
commit af5a6e37b2

View File

@ -76,11 +76,11 @@ const getConfig = ({ baseUrl, rootPath, s3Options, ...legacyS3Options }: InitOpt
"S3 configuration options passed at root level of the plugin's providerOptions is deprecated and will be removed in a future release. Please wrap them inside the 's3Options:{}' property."
);
}
const credentials = extractCredentials({ s3Options, ...legacyS3Options });
const config = {
...s3Options,
...legacyS3Options,
credentials: extractCredentials({ s3Options, ...legacyS3Options }),
...[credentials ? { credentials } : {}],
};
config.params.ACL = getOr(ObjectCannedACL.public_read, ['params', 'ACL'], config);