Files
pnpm/__patches__
Zoltan Kochan 1166108f79 fix(auth): normalize subpath registry URLs with a trailing slash (#13137)
pnpm login, pnpm adduser, and pnpm logout dropped the last path segment
of a registry hosted under a URL subpath when the configured URL had no
trailing slash: normalize-registry-url 2.0.1 returns URLs that already
contain a path unchanged instead of appending the slash, and the WHATWG
relative resolution used to build the -/v1/login, couchdb-user, and
token-revocation endpoints then resolves against the truncated parent
path. The auth token was likewise stored under a truncated key.
Registries at a domain root were unaffected, and so were subpath URLs
written with a trailing slash.

Fix the package once for every consumer (config reader, login, logout,
publish registry keys) with a patchedDependencies patch that always
appends the trailing slash, matching the Rust CLI, whose normalization
was already correct. The lockfile diff is limited to the patch hashes;
the unrelated peer-context re-resolution a full install wanted to make
was reverted deliberately.

The config-reader test expectations that encoded the old truncating
behavior are updated to expect the trailing slash. The Rust side gains
the mirrored subpath-without-trailing-slash tests for web login, classic
login, and logout; its behavior is unchanged.
2026-07-19 10:39:46 +02:00
..