import { Router } from "express";
import { AuthController } from "./controller.js";
import { AuthMiddleware } from "../middlewares/auth.middleware.js";

export class AuthRoutes {

    static get routes(): Router {

        const router = Router();
        const controller = new AuthController();

        router.post('/register', controller.registerUser);
        router.post('/login', controller.loginUser);

        // Ruta protegida para probar JWT
        router.get('/me', AuthMiddleware.validateJwt, controller.getMe);

        return router;
    }
}