diff --git a/lib/s3.js b/lib/s3.js index a2feaee..d11c3d4 100644 --- a/lib/s3.js +++ b/lib/s3.js @@ -50,6 +50,11 @@ module.exports = CoreObject.extend({ accessKeyId: accessKeyId, secretAccessKey: secretAccessKey, }; + + if (sessionToken) { + this.plugin.log('Using AWS session token from config', { verbose: true }); + s3Options.credentials.sessionToken = sessionToken; + } } if (signatureVersion) { @@ -57,11 +62,6 @@ module.exports = CoreObject.extend({ s3Options.signatureVersion = signatureVersion; } - if (sessionToken) { - this.plugin.log('Using AWS session token from config', { verbose: true }); - s3Options.sessionToken = sessionToken; - } - if (profile && !this.plugin.readConfig('s3Client')) { this.plugin.log('Using AWS profile from config', { verbose: true }); s3Options.credentials = fromIni({ profile: profile });