In version 4.3.1 with default options, I noticed that when the Authorization header is just Bearer, the token parameter that is passed to the validate function is undefined. Looking through the code, it seems to me that this is the case for current master as well. Although this behavior is reasonable, I wonder if it would be more appropriate to reply with Boom.unauthorized? I don't see how not having a token should ever result in a successful authentication, so it would be convenient for the middleware to handle that case.
In version 4.3.1 with default options, I noticed that when the
Authorization
header is justBearer
, thetoken
parameter that is passed to thevalidate
function isundefined
. Looking through the code, it seems to me that this is the case for current master as well. Although this behavior is reasonable, I wonder if it would be more appropriate to reply withBoom.unauthorized
? I don't see how not having a token should ever result in a successful authentication, so it would be convenient for the middleware to handle that case.