github-cognito-openid-wrapper
github-cognito-openid-wrapper copied to clipboard
Fix/logging
Without these envs in config.sh
the wrapper fails in web mode:
export GITHUB_API_URL="https://api.github.com"
export GITHUB_LOGIN_URL="https://github.com"
I'll create a draft PR since I have a naive logger there that should be removed and you might want to have an input on how that is implemented for getUserEmails
.
Ah, nice catch. Apologies for that.
I reckon we could put the logging in gitHubGet
and in check
- which would let us know a bit more about what the user was up to.
There isn't currently a well-reasoned error handling system (because at the time I wrote this, the errors cognito received weren't exposed, so it didn't seem necessary). If you think it would be useful, we could implement custom error types that are then marshalled to appropriate http codes at the connector boundary.
Thinking about it, the specific error you hit could be caught and warned about - like if the logger said "Unable to retrieve users emails- does the app have appropriate permissions?" or something.