- This middleware is used to validate the token in the cookies.
- It takes the token from
req.cookies.token - If the token is not present it will send a response with status 401
- If the token is invalid it will send a response with status 401
- If the token is valid it will call the next middleware , the decoded payload is stored in
req.decoded