### Is there an existing issue for this? - [X] 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 1. In this environment... * Go to: https://www.npmjs.com/settings/USER_NAME/tokens * Make a Read-Only token. Keep it's value. [  ](url) * 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.
Activity
wraithgar commentedon May 3, 2022
cli/lib/commands/logout.js
Line 39 in 7a85827