File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
packages/core/src/auth/providers Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -413,17 +413,16 @@ export class SharedCredentialsProvider implements CredentialsProvider {
413413 secretAccessKey : sourceProfile . aws_secret_access_key ! ,
414414 } )
415415 // Prompt for MFA Token if needed.
416- const assumeRoleReq = profile . mfa_serial
417- ? {
418- RoleArn : profile . role_arn ,
419- RoleSessionName : 'AssumeRoleSession' ,
420- SerialNumber : profile . mfa_serial ,
421- TokenCode : await getMfaTokenFromUser ( profile . mfa_serial , this . profileName ) ,
422- }
423- : {
424- RoleArn : profile . role_arn ,
425- RoleSessionName : 'AssumeRoleSession' ,
426- }
416+ const assumeRoleReq = {
417+ RoleArn : profile . role_arn ,
418+ RoleSessionName : 'AssumeRoleSession' ,
419+ ...( profile . mfa_serial
420+ ? {
421+ SerialNumber : profile . mfa_serial ,
422+ TokenCode : await getMfaTokenFromUser ( profile . mfa_serial , this . profileName ) ,
423+ }
424+ : { } ) ,
425+ }
427426 const assumeRoleRsp = await stsClient . assumeRole ( assumeRoleReq )
428427 return {
429428 accessKeyId : assumeRoleRsp . Credentials ! . AccessKeyId ! ,
You can’t perform that action at this time.
0 commit comments