Function that validate and get the token from the header request and will return a 401 if a valid JWT bearer token in the request is not provided or has an invalid format.
Since is agnostic to the framework, it needs to be called within a middleware and is not necessary to pass the complete headers object
since each framework has different ways to handle the request object, it could be an small object with authorization and content-type headers only.
Function that validate and get the token from the header request and will return a 401 if a valid JWT bearer token in the request is not provided or has an invalid format.
Since is agnostic to the framework, it needs to be called within a middleware and is not necessary to pass the complete headers object since each framework has different ways to handle the request object, it could be an small object with
authorization
andcontent-type
headers only.Example: