OTP verify screen resets after leaving app to copy code from email
Report (user video)
After requesting an OTP by email in the app, if the user closes/backgrounds the app, opens Mail, copies the code, then returns to the app, the flow resets and asks for email/phone again instead of staying on the code entry step with the same destination address.
Expected
Returning to the app should still show Verify OTP for the same type + value (email/phone) until the user verifies, cancels, or the OTP truly expires — same as staying in-app.
Likely cause (inspector-app)
login.tsxpushesverify-otpwith route params only:{ type, value }.verify-otp.tsxreads identity only fromuseLocalSearchParams(value,type).- On iOS/Android, process death, aggressive memory reclaim, or navigation state restore can drop the stack/params, sending the user back to login or leaving verify with an empty
value.
Suggested direction
- Persist pending OTP context when entering verify (e.g.
SecureStore/expo-secure-storeor encrypted async storage):type,value, optional timestamp. - On
verify-otpmount, if params are missing/empty, hydrate from storage; if still nothing, redirect to login. - Clear storage on successful verify, explicit “Change email/phone”, or logout.
- Re-test: background → Mail → copy → resume; force-kill app → relaunch → should recover or fail gracefully with one clear path (not silent reset to login without explanation).
Code refs
inspector-app/app/(auth)/login.tsx—router.pushto/verify-otpwith paramsinspector-app/app/(auth)/verify-otp.tsx—useLocalSearchParamsfortype/value
Acceptance criteria
- [ ] Repro above: user returns to app and can still enter OTP for the same email without re-entering it.
- [ ] Cold start after kill: either restore verify state or show intentional UX (not ambiguous reset).
- [ ] Phone OTP path behaves the same if applicable.
Status: Completed
Log in to comment and vote
No comments yet
Be the first to share your thoughts.