-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Bug report
2FA not working when using yarn publish
despite the implementation in #6555 .
cc: @neonowy
What is the current behavior?
There are three cases I tried:
npm login
beforeyarn publish
yarn login
beforeyarn publish
- log out and make sure there is no _authCode in
~/.yarnrc
beforeyarn publish
In case 1 and 2 I receive the error "You must provide a one-time pass. Upgrade your client to npm@latest in order to use 2FA."
In case 3, it asks me to log in but even though I type the correct password, I receive an error message saying Incorrect username or password.
.
STR:
- Create a new package from a boilerplate.
- Have the following set in your package.json:
{
...
"version": "0.5.0",
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
...
}
- run
yarn publish --new-version major
A bit of background (probably unrelevant to this bug): I've had my package up until now in a private registry, now it's being open sourced. I'm moving the package to NPM with a major version bump.
What is the expected behavior?
In cases 1 and 2, I would expect yarn to execute this line and ask for the OTP code.
In case 3, I would expect it to correctly validate my password and then ask for the OTP code.
Please mention your node.js, yarn and operating system version.
- Node version:
v9.11.1
- Yarn version:
1.10.1
- NPM version:
6.4.1
(I'm providing it just because of the error message) - OS version:
macOS High Sierra 10.13.6 (17G3025)