- Add explicit IRouter type to all route files - Add explicit Express type to app.ts - Fix env.ts by moving getCorsOrigins after parsing - Fix token.ts SignOptions type for expiresIn - Cast req.params.id to String() in controllers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
14 lines
497 B
TypeScript
14 lines
497 B
TypeScript
import { Router, type IRouter } from 'express';
|
|
import * as authController from '../controllers/auth.controller.js';
|
|
import { authenticate } from '../middlewares/auth.middleware.js';
|
|
|
|
const router: IRouter = Router();
|
|
|
|
router.post('/register', authController.register);
|
|
router.post('/login', authController.login);
|
|
router.post('/refresh', authController.refresh);
|
|
router.post('/logout', authController.logout);
|
|
router.get('/me', authenticate, authController.me);
|
|
|
|
export { router as authRoutes };
|