fix: 2FA code request error alert - WPB-24847#4609
fix: 2FA code request error alert - WPB-24847#4609johnxnguyen wants to merge 7 commits intorelease/cycle-4.16from
Conversation
|
Test Results 7 files 775 suites 6m 2s ⏱️ Results for commit 067dfea. Summary: workflow run #24748763385 |
netbe
left a comment
There was a problem hiding this comment.
lgtm:) left a few comments
| if viewModel.retryAfterSeconds > 0 { | ||
| Text(Strings.VerificationCode.resendCodeAfterSeconds(viewModel.retryAfterSeconds)) | ||
| .monospacedDigit() | ||
| } else { | ||
| Text(Strings.VerificationCode.resendCode) | ||
| } |
There was a problem hiding this comment.
suggestion: move if else inside viewModel
There was a problem hiding this comment.
Do you mean to just have something like Text(viewModel.resendButtonTitle)?
| let retryAfter = responseHeaders["retry-after"].flatMap { TimeInterval($0) } | ||
| throw AuthenticationAPIError.tooManyRequests(error.message, retyAfter: retryAfter) |
There was a problem hiding this comment.
thought: I wonder if this information could be a security concern
There was a problem hiding this comment.
The information that there is a rate limit? Or the number seconds until the limit is removed?



Issue
2FA codes from the backend can only be requested once within a time interval. If the code is requested multiple times in within the interval it will return a 429 "too many request" error.
This error is not handled in any particular way and is surfaced to the error as a generic "something went wrong" alert which confuses the user.
Simulator.Screen.Recording.-.A.-.2026-04-21.at.23.48.37.mov
This PR improves the error handling to better inform the user what is going on by:
Simulator.Screen.Recording.-.A.-.2026-04-21.at.23.26.30.mov
Simulator.Screen.Recording.-.A.-.2026-04-21.at.23.31.29.mov
Testing
Checklist
[WPB-XXX].UI accessibility checklist
If your PR includes UI changes, please utilize this checklist: