Skip to content

Conversation

@mattt
Copy link
Contributor

@mattt mattt commented Jun 6, 2023

Fixes #76

This PR throws if the auth parameter passed to new Client({ ... }) is missing. Specifically, this PR uses an if (!options.auth) conditional, which is satisfied by falsy values including null, undefined, and "".

@mattt mattt requested a review from zeke June 6, 2023 20:41
@mattt
Copy link
Contributor Author

mattt commented Jun 6, 2023

Specifically, this PR uses an if (!options.auth) conditional, which is satisfied by falsy values including null, undefined, and "".

I'm not 100% sure about matching on empty string, because the client may configure a custom base URL to talk to a proxy that doesn't require authentication. Thoughts, @zeke?

@mattt mattt merged commit a06fa0d into main Jun 9, 2023
@mattt mattt deleted the mattt/throw-on-missing-auth branch June 9, 2023 12:52
@zeke
Copy link
Member

zeke commented Jun 10, 2023

NOICE

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.

throw an error if the API token is undefined

3 participants