-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 1high priority issuehigh priority issueRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
NPM Logout removes the wrong token leaving the login token available. Reproduced in v6, v7, and v8.0.0.
Expected Behavior
NPM login adds an access token to npm config user section.
NPM logout removes an access token from npm config user section.
Steps To Reproduce
- In this environment...
- Go to: https://www.npmjs.com/settings/USER_NAME/tokens
- Make a Read-Only token. Keep it's value.

- Make a new folder: mkdir test & cd test
- Run: npm init
- Add .npmrc: echo "//registry.npmjs.org/:_authToken=READ_ONLY_TOKEN" > .npmrc
- Login: npm login (See second access token created)

- Logout: npm logout (See wrong token removed. Readonly token was deleted)

Environment
- OS: Ubuntu
- Node: v14.18.0
- npm: Last version tested was 8.0.0, but could recreate in 6 and 7.
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 1high priority issuehigh priority issueRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release