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

logging failed requests #332

Open nitrocode opened 4 years ago

nitrocode commented 4 years ago

How do I log failed requests? I want to verify if the authorization header is coming in correctly.

nelsonic commented 4 years ago

@nitrocode good question. You can log anything you want in your validate function. All the detail from the original HTTP request is available in the request object so you can easily check the auth headers. Please see: https://hapi.dev/api/?v=18.4.0#request-lifecycle