import type { Express, Request, Response } from "express";
import { requireAuth } from "../../../pkg/middleware/authMiddleware.js";
import login from "./login.js";
import me from "./me.js";
import register from "./register.js";
import resetPassword from "./resetPassword.js";
import userRoles from "./userroles.js";

export const setupAuthRoutes = (app: Express, basePath: string) => {
	app.use(basePath + "/api/user/login", login);
	app.use(basePath + "/api/user/me", requireAuth(), me);
	app.use(basePath + "/api/user/resetpassword", resetPassword);
	app.use(basePath + "/api/user/register", register);
	app.use(basePath + "/api/user/roles", requireAuth(), userRoles);
};
