Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,10 @@ function config () {
})
} else {
conf = conf.concat({ auth: {} })
conf.auth = {}
}
if (conf.otp) conf.auth.otp = conf.otp
if (conf.otp) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This second bit is actually not what you want. It means that npm token <whatever> --otp=123456 will throw away the auth.

Since we've already set auth to an object, we can modify that object, because it's not a key on the figgy pudding container.

I'll land this, but without that part, just posting this comment for posterity :)

conf = conf.concat({ auth: { otp: conf.otp } })
}
return conf
}

Expand Down