Skip to content

Commit 0eee0e8

Browse files
committed
Tidy up credentials arguments
1 parent 0442107 commit 0eee0e8

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/guardian/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@ const failTitleLog = chalk.redBright.underline.bold;
2020

2121
class GuardianCI {
2222
constructor(program) {
23-
AWS.config.credentials = getAWSCredentials(
24-
program.profile,
25-
program,
26-
null,
27-
true
28-
);
23+
AWS.config.credentials = getAWSCredentials(program.profile, program);
2924
if (program.region) {
3025
AWS.config.region = program.region;
3126
}

src/services/awsCredentials.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import AWS from "aws-sdk";
22

33
import { promptMfaModal } from "../modals";
44

5-
function getAWSCredentials(profile, program, screen, isGuardian = false) {
5+
function getAWSCredentials(profile, program, screen) {
66
let codeFn;
77
if (program.mfa) {
8-
const token = program.mfa;
9-
codeFn = (serial, callback) => callback(null, token);
10-
} else if (!isGuardian) {
8+
codeFn = (serial, callback) => callback(null, program.mfa);
9+
} else if (screen) {
1110
codeFn = (serial, callback) => promptMfaModal(callback, screen);
1211
} else {
1312
codeFn = () =>

0 commit comments

Comments
 (0)