Files
Checkmate/server/src/routes/v1/inviteRoute.js
T

22 lines
661 B
JavaScript
Raw Normal View History

2025-04-20 11:29:53 -07:00
import { Router } from "express";
2026-01-20 23:07:31 +00:00
import { isAllowed } from "../../middleware/isAllowed.js";
2025-04-20 11:29:53 -07:00
class InviteRoutes {
constructor(inviteController, verifyJWT) {
2025-04-20 11:29:53 -07:00
this.router = Router();
this.inviteController = inviteController;
this.initRoutes(verifyJWT);
2025-04-20 11:29:53 -07:00
}
initRoutes(verifyJWT) {
2025-07-23 14:58:44 -07:00
this.router.post("/send", verifyJWT, isAllowed(["admin", "superadmin"]), this.inviteController.sendInviteEmail);
this.router.post("/verify", this.inviteController.verifyInviteToken);
2025-07-21 10:34:16 -07:00
this.router.post("/", verifyJWT, isAllowed(["admin", "superadmin"]), this.inviteController.getInviteToken);
2025-04-20 11:29:53 -07:00
}
getRouter() {
return this.router;
}
}
export default InviteRoutes;