Skip to content

chore: add web-login proxy doneUrl regression for npm-profile fix#9560

Draft
manzoorwanijk wants to merge 1 commit into
npm:latestfrom
manzoorwanijk:test/web-login-proxy-doneurl-integration
Draft

chore: add web-login proxy doneUrl regression for npm-profile fix#9560
manzoorwanijk wants to merge 1 commit into
npm:latestfrom
manzoorwanijk:test/web-login-proxy-doneurl-integration

Conversation

@manzoorwanijk

Copy link
Copy Markdown
Contributor

Adds a regression test for #8875. The fix is in npm-profile (npm/npm-profile#191).

This test is expected to be red until bundled npm-profile is bumped to the release with the fix, and turns green after that.

Why

npm login --auth-type=web silently fails behind a proxy/mirror: the returned doneUrl points at the canonical registry.npmjs.org instead of the proxy, so npm polls the wrong host, gets a 403, and falls back to couch auth (which also fails). Fixed in npm-profile by rewriting doneUrl to the configured registry origin.

How

  • @npmcli/mock-registry: weblogin() gains an optional doneRegistry to emulate a proxy advertising a doneUrl on another origin.
  • test/lib/commands/login.js: proxy registry whose doneUrl is on registry.npmjs.org; asserts the token is saved with no couch fallback. Fails with the current bundled npm-profile, passes once it is bumped.

References

Fixes #8875
Depends on: npm/npm-profile#191
Related: #9550

@manzoorwanijk manzoorwanijk force-pushed the test/web-login-proxy-doneurl-integration branch from e07a39d to 24f64a5 Compare June 16, 2026 18:08
@manzoorwanijk manzoorwanijk changed the title test: add web-login proxy doneUrl regression for npm-profile fix chore: add web-login proxy doneUrl regression for npm-profile fix Jun 16, 2026
@manzoorwanijk

Copy link
Copy Markdown
Contributor Author

@owlstronaut we can update and land this once npm/npm-profile#191 lands in this repo after release and bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] NPM Login Failure Blocking Package Installation

1 participant