Skip to content

Commit bc7fd6f

Browse files
committed
feat: add password recovery routes
- Add POST /api/auth/forgot-password route - Add POST /api/auth/reset-password route - Add routes to public routes configuration - Apply rate limiting to password recovery endpoints
1 parent 15da2b2 commit bc7fd6f

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

backend/src/config/auth.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export const authConfig = {
4646
"/api/auth/login",
4747
"/api/auth/register",
4848
"/api/auth/refresh",
49+
"/api/auth/forgot-password",
50+
"/api/auth/reset-password",
4951
"/api/health",
5052
"/api/docs",
5153
"/api/public",

backend/src/routes/auth.routes.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import {
1616
loginWithEmail,
1717
getSessions,
1818
deactivateSession,
19+
forgotPassword,
20+
resetPassword,
1921
} from "@/controllers/auth.controller";
2022
import {
2123
authenticateToken,
@@ -41,6 +43,10 @@ router.post("/login/email", authLimiter, loginWithEmail); // Alias for email/pas
4143
router.post("/refresh", validateRefreshToken, refresh);
4244
router.post("/logout", validateRefreshToken, logout);
4345

46+
// Password recovery routes
47+
router.post("/forgot-password", authLimiter, forgotPassword);
48+
router.post("/reset-password", authLimiter, resetPassword);
49+
4450
// User routes
4551
router.get("/me", authenticateToken(), me);
4652
router.get("/sessions", authenticateToken(), getSessions);

0 commit comments

Comments
 (0)