feat: Add OTP resend timer functionality to ConfirmCode - [CU-869bgc23c] - #242
Merged
Conversation
Exo1i
requested review from
AhmedSobhy01,
AmrSamy59,
LoayAhmed304 and
im-saif
as code owners
December 15, 2025 15:33
Member
Author
im-saif
approved these changes
Dec 15, 2025
tonynagyy
approved these changes
Dec 15, 2025
Unit Tests Coverage ReportCoverage after merging feat/reset-password-timer into dev will be
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the
ConfirmCodepassword reset flow by introducing and testing a resend code timer. The timer prevents users from immediately requesting a new code, ensuring a 60-second delay between resend attempts. The changes include both updates to the component logic and comprehensive tests to verify timer behavior and edge cases.Timer and resend logic improvements:
resendTimer) to theConfirmCodecomponent, which starts at 60 seconds on screen load and after a successful resend, preventing the resend button from being used until the timer expires. The timer is managed using auseEffecthook and cleared appropriately. [1] [2] [3] [4]Test suite enhancements:
ConfirmCodeto cover timer initialization, countdown behavior, button state transitions, and edge cases such as failed resend attempts not restarting the timer. [1] [2] [3] [4] [5] [6] [7] [8]These changes ensure a more robust and user-friendly password reset experience by enforcing resend limits and providing clear feedback to the user.