-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: update throttle limits for company and user endpoints #1583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -145,7 +145,7 @@ export class UserController { | |||||
| description: 'Login successful.', | ||||||
| type: TokenExpDs, | ||||||
| }) | ||||||
| @Throttle({ default: { limit: isTest() ? 200 : 5, ttl: 60000 } }) | ||||||
| @Throttle({ default: { limit: isTest() ? 200 : 10, ttl: 60000 } }) | ||||||
| @Post('user/login/') | ||||||
| async usualLogin( | ||||||
| @Res({ passthrough: true }) response: Response, | ||||||
|
|
@@ -252,6 +252,7 @@ export class UserController { | |||||
| description: 'Email verification requested.', | ||||||
| type: OperationResultMessageDs, | ||||||
| }) | ||||||
| @Throttle({ default: { limit: isTest() ? 200 : 5, ttl: 60000 } }) | ||||||
| @Get('user/email/verify/request') | ||||||
|
||||||
| @Get('user/email/verify/request') | |
| @Post('user/email/verify/request') |
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The throttle configuration object (ttl 60000, isTest() ? 200 : ...) is duplicated across multiple handlers in this controller, which increases the chance of inconsistent limits when changes are needed. Consider extracting shared throttle presets/helpers (e.g., 5/min, 10/min) into a constant or small factory to keep these values centralized.
Copilot
AI
Feb 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GET user/email/change/request/ appears to trigger a side effect (sending an email change verification). Using GET for state-changing operations can lead to unintended requests (prefetching/crawlers) and makes caching semantics unsafe. Consider switching this endpoint to POST (or otherwise ensuring it is truly safe/idempotent and not cacheable).
| @Get('user/email/change/request/') | |
| @Post('user/email/change/request/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same inline throttle configuration pattern (ttl 60000,
isTest() ? 200 : ...) is repeated for multiple endpoints. Consider centralizing these throttle presets (e.g., constants/factory) to avoid divergence when limits are tuned in the future.