0f7af70b90
Updated Docker configuration, refactored middleware for improved error handling, and restructured account, order, plan, profile, and support modules, including their routes, services, and validations. Enhanced email processing queues and utilities for token generation, pagination, and response management to streamline the application architecture and enhance maintainability.
17 lines
1.4 KiB
JavaScript
17 lines
1.4 KiB
JavaScript
import { Router } from "express";
|
|
import auth from "../../middlewares/auth.js";
|
|
import RequestValidator from "../../middlewares/request_validator.js";
|
|
import { account_controller } from "./account.controller.js";
|
|
import { account_validation } from "./account.validation.js";
|
|
const accountRouter = Router();
|
|
accountRouter.post("/sign-up", RequestValidator(account_validation.sign_up), account_controller.create_account);
|
|
accountRouter.post("/sign-in", RequestValidator(account_validation.sing_in), account_controller.login_user);
|
|
accountRouter.put("/verify-otp", RequestValidator(account_validation.verify_otp), account_controller.verify_account_using_otp);
|
|
accountRouter.put("/verify-link", RequestValidator(account_validation.verify_link), account_controller.verify_account_using_link);
|
|
accountRouter.get("/me", auth("USER", "ADMIN"), account_controller.get_user_account);
|
|
accountRouter.put("/change-password", auth("USER", "ADMIN"), RequestValidator(account_validation.change_password), account_controller.change_password);
|
|
accountRouter.put("/resend-otp", RequestValidator(account_validation.resend_otp), account_controller.resend_otp_and_verification_link);
|
|
accountRouter.put("/forget-password", RequestValidator(account_validation.resend_otp), account_controller.forget_password_generate_reset_token);
|
|
accountRouter.put("/reset-password", RequestValidator(account_validation.reset_pass), account_controller.reset_password_using_token);
|
|
export default accountRouter;
|