Open willstott101 opened 2 years ago
I left a few comments, it will take time to go through this change more thoroughly.
Sure, will address those a bit later today. Once using the library after this refactor... requiring throwing from authenticate
feels a bit off. Do you think returning false
would be better?
Git
class which allows theauthenticate
function to respond with a context value (inspired by thecontext
callback inApolloServer
).authenticate
calls).Aside from the changes to authenticate every request the re-factoring was mostly to help me reduce the number of code paths that need to be supported.
The more optionally-async optionally-promise callbacks we support the messier the code becomes and it was hard for me to be confident all code branches were correct.
That being said I'm happy to go backwards on some of this refactoring now that it all seems to work.
Left as a WIP as I want to expand the test suite to cover more error cases.