microsoft / ado-npm-auth

This package can automatically use the azureauth CLI to fetch tokens and update a user's .npmrc file for authenticating to Azure DevOps npm feeds.
MIT License
11 stars 9 forks source link

fix: stop swallowing errors from azureauth #26

Closed MatanBobi closed 6 months ago

MatanBobi commented 6 months ago

At the moment, if we get an error from AzureAuth and not a JSON, we throw an irrelevant error saying "Encountered error while performing auth Error: Unexpected end of JSON input", this PR fixes that and throws the actual string we received.

I'm hesitating whether we should assert on something specific there inside the catch to make sure we're not printing tokens. Any thoughts?

jcreamer898 commented 6 months ago

I think it should be ok,