MiddlewareLogic - IEEE-Team-3/map GitHub Wiki
- Verifies JWT token and attaches user info to
req.user
.
- Redirects to login if token is missing or invalid.
Role-based Access Control
- Checks if the current user has the required role in the team.
- Can be extended using decorators or route-level logic.
- Uses libraries like
zod
or express-validator
.
- Ensures correct data types and required fields.
- Global error handler catches exceptions and sends clean JSON responses.
- Differentiates between expected (e.g., validation) and unexpected errors.
- Prevents abuse on public routes like login/register.
- Helmet + CORS + sanitizers to protect the app.
⚠️ **GitHub.com Fallback** ⚠️