Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix figgyPudding error in npm token #259

Closed
wants to merge 1 commit into from
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