Skip to content

Commit fcc3a87

Browse files
committed
fix(plugin-serverless): handle direct username/password input
Previously if you'd call `twilio serverless:deploy` or similar commands with `--username` and `--password` explicitly passed as API Key/Secret, it would both read the Service SID and write the Service SID in the deployinfo cache for the Account SID that was associated with the default profile. This change will ignore the default profile/client if username or password are passed. BREAKING CHANGE: You have to use --username and --password effectively together if you use either fix #261
1 parent 326db3a commit fcc3a87

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/plugin-serverless/src/utils.js

+11
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ function normalizeFlags(flags, aliasMap) {
6969
function createExternalCliOptions(flags, twilioClient) {
7070
const profile = flags.profile;
7171

72+
if (flags.username || flags.password) {
73+
return {
74+
username: flags.username,
75+
password: flags.password,
76+
accountSid: flags.username.startsWith('AC') ? flags.username : undefined,
77+
profile: undefined,
78+
logLevel: undefined,
79+
outputFormat: undefined,
80+
};
81+
}
82+
7283
return {
7384
username: twilioClient.username,
7485
password: twilioClient.password,

0 commit comments

Comments
 (0)