Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions apps/dashboard-api/src/routes/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ router.post('/reset-password', authLimiter, resetPassword);
router.get('/github/start', startGithubAuth);
router.get('/github/callback', handleGithubCallback);

// OTP and password-reset routes must use authLimiter (10 req/15 min) because
// they are credential-adjacent endpoints. Placing them before router.use(dashboardLimiter)
// ensures only authLimiter applies; they never fall through to the 1000 req/15 min bucket.
router.post('/send-otp', authLimiter, sendOtp);
router.post('/verify-otp', authLimiter, verifyOtp);
router.post('/forgot-password', authLimiter, forgotPassword);
router.post('/reset-password', authLimiter, resetPassword);

router.use(dashboardLimiter);

router.put('/change-password', authorization, changePassword);
Expand Down