From 36ad90eda6028f5aa0150168f2c45140c09b6de3 Mon Sep 17 00:00:00 2001 From: Mathis Date: Thu, 25 Apr 2024 14:23:13 +0200 Subject: [PATCH] feat(controllers): Refactor AuthController and update router reference - Revised comments replacing 'TODO' with 'FIX' and 'FEAT' in AuthController. - Renamed 'AuthController.ts' to 'auth.controller.ts' and updated the reference in the router. - Planned for implementing re-auth by current password in case of password change. Signed-off-by: Mathis --- src/controllers/{AuthController.ts => auth.controller.ts} | 4 ++-- src/routes/auth/router.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename src/controllers/{AuthController.ts => auth.controller.ts} (99%) diff --git a/src/controllers/AuthController.ts b/src/controllers/auth.controller.ts similarity index 99% rename from src/controllers/AuthController.ts rename to src/controllers/auth.controller.ts index f4e81b7..66f5c80 100644 --- a/src/controllers/AuthController.ts +++ b/src/controllers/auth.controller.ts @@ -9,7 +9,7 @@ import {Logger} from "tslog"; const logger = new Logger({ name: "AuthController" }); -//TODO Better return object interface +//FIX Better return object interface /** * Registers a user with the given request data. * @@ -232,7 +232,7 @@ async function getUser(req: Request, res: Response) { .json(dbUser); } -//TODO - Implement re-auth by current password in case of password change +//FEAT - Implement re-auth by current password in case of password change async function editUser(req: Request, res: Response) { const body: IReqEditUserData | null = req.body; if (!body) { diff --git a/src/routes/auth/router.ts b/src/routes/auth/router.ts index b4de6b6..0ae3d5e 100644 --- a/src/routes/auth/router.ts +++ b/src/routes/auth/router.ts @@ -1,7 +1,7 @@ import express, {type Router} from "express"; import UserGuard from "@validators/UserGuard"; import AdminGuard from "@validators/AdminGuard"; -import AuthController from "@controllers/AuthController"; +import AuthController from "@controllers/auth.controller"; const router: Router = express.Router();