Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(publish): follow all configs for registry auth check #2602

Merged
merged 1 commit into from Feb 4, 2021

Conversation

wraithgar
Copy link
Member

The "do you have auth configured" only takes into consideration a hard-coded
"registry" config, which means that if you don't have auth configured for
the npm registry, but you do for the one you have tied to a scope elsewhere
in your npmrc, we would erroneously tell you that to add a token.

This uses the same method that the rest of the publish chain uses to determine
which registry it would be publishing to, then sees if you have auth for THAT registry.

Because that other function does a hard fallback to the npm registry, there is no more
need for the exception we throw if you do not have one configured. Also, the npm cli
already defaults that config item, so you can't even set it to a falsey value if you
wanted

References

Closes #2567

@wraithgar wraithgar marked this pull request as ready for review February 2, 2021 23:21
@wraithgar wraithgar requested a review from a team as a code owner February 2, 2021 23:21
@darcyclarke darcyclarke added Release 7.x work is associated with a specific npm 7 release release: next These items should be addressed in the next release labels Feb 3, 2021
@wraithgar wraithgar marked this pull request as draft February 4, 2021 17:28
@wraithgar
Copy link
Member Author

Found bugs while improving the tests around this. More commits incoming.

@wraithgar wraithgar changed the title fix(publish): follow config for registry auth check fix(publish): follow all configs for registry auth check Feb 4, 2021
@wraithgar wraithgar force-pushed the gar/alt-registry-auth branch 3 times, most recently from 8572e95 to ff241c4 Compare February 4, 2021 18:47
@wraithgar wraithgar marked this pull request as ready for review February 4, 2021 18:47
@wraithgar wraithgar force-pushed the gar/alt-registry-auth branch 3 times, most recently from ef15bd3 to e84e9d3 Compare February 4, 2021 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: next These items should be addressed in the next release Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] npm publish and npm install fail depending on .npmrc syntax used
3 participants