-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerssecurity
Milestone
Description
Description
Add a robust and secure OTP resend mechanism to complement the OTP code generator feature. This will allow users to request a new OTP if the previous one expires or is not received, while protecting the system from abuse (e.g., spamming resend requests).
Acceptance Criteria
- Controller Endpoint to trigger OTP resend: POST /auth/resend-otp
- Validate phoneNumber before sending
- Limit resend attempts (e.g., max 3 within 10 minutes)
- Use same OTP if still valid; generate a new one only if expired
- Store/send via preferred channel (WhatsApp).
Suggested Implementation
- Add a ResendOtpRequest DTO
- Extend existing OtpService with ResendOtpAsync(phoneNumber)
- Use timestamp tracking to throttle excessive requests
- Consider integrating Redis for rate-limiting
- Unit test different edge cases: expired OTP, excessive requests, etc.
Feel free to drop a comment if you need clarification
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerssecurity