-
Notifications
You must be signed in to change notification settings - Fork 29
fix: validate creds #222
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: validate creds #222
Conversation
} | ||
|
||
// For 401 errors, fall through to unauthenticated endpoint | ||
delete headers["Authorization"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we ever get here? Doesn't hurt to have it just in case, but also wondering if I'm not seeing something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, if someone sets connection string + invalid api keys, we let them start the server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if fetch errors, we'd get here right? actually not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'd get here if we get a 401, if any other error, we do nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, my point was that we need to get a 401 wrapped in a ApiClientError
, which fetch
shouldn't be doing, should it? The only place we can throw ApiClientError
is on line 146, but that explicitly avoids throwing for 401s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it! i think you're right, let me try to fix it
fixes #221