Authentication middleware for ReST API. Those APIs that use this middleware won't receive the request unless the authorization header is properly configured
with a valid JWT token. If the middleware passes, the req object will have an account property with the account data.
Parameters
req: Request
res: Response
next: NextFunction
Returns Promise<void>
a 401 if the token is not present or if the token is not correct, the next function result otherwise
Authentication middleware for ReST API. Those APIs that use this middleware won't receive the request unless the authorization header is properly configured with a valid JWT token. If the middleware passes, the req object will have an account property with the account data.