dwyl / hapi-auth-jwt2

:lock: Secure Hapi.js authentication plugin using JSON Web Tokens (JWT) in Headers, URL or Cookies
ISC License
798 stars 126 forks source link

More details within errorFunc #442

Closed joshkel closed 9 months ago

joshkel commented 10 months ago

I'm interested in more control over hapi-auth-jwt2's error-handling behavior. Specifically:

I realize I could provide a custom verify function to do all of this, but it seems like it may be worth adding additional information to errorFunc to give it more context so it can do this itself. (It seems to fit logically there, and others have requested similar functionality, and overriding verify adds complexity and the possibility of security-sensitive bugs.) Specifically:

Rather than adding extra parameters to errorFunc, it makes sense to me to add these within the ErrorContext parameter.