Module: authMiddleware

This middleware verifies the JWT token and attaches the decoded user information to the request object. If the token is invalid or missing, it sends a 401 Unauthorized response.
Source:

Methods

(inner) verifyToken(req, res, next) → {Object}

Verify JWT token.
Parameters:
Name Type Description
req Object Express request object
res Object Express response object
next function Express next middleware function
Source:
Returns:
- 401 Unauthorized response if token is invalid or missing
Type
Object