fix(auth): correct verification alert messages for email and phone#3083
fix(auth): correct verification alert messages for email and phone#3083v1nayG wants to merge 1 commit into
Conversation
Greptile SummaryThis PR fixes a bug in
Confidence Score: 5/5Safe to merge — the change is a targeted fix to notification message logic with no side effects on the SDK calls or store invalidation flow. The fix correctly captures state before the async SDK call and store invalidation in all three functions. The logic is straightforward, the old bug was real and well-diagnosed, and the new code produces the correct messages in all branches. No data mutations, no new async patterns, and no cross-file dependencies are affected. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(auth): correct verification alert me..." | Re-trigger Greptile |
Both updateVerificationEmail and updateVerificationPhone read the user store after invalidation to build the success notification. At that point the store already reflects the new state, so the ternary produces the opposite message — showing 'unverified' after verifying and vice versa. Capture the intended verification state and display label before the API call so the notification always matches the action the user just performed. Also disambiguate the messages to indicate whether the email or phone was verified when the user has both.
98206bf to
59e0ad3
Compare
What does this PR do?
Both
updateVerificationEmailandupdateVerificationPhoneinupdateStatus.sveltewere reading the user store after invalidation to build the success notification. At that point, the store already reflected the new state, so the ternary produced the opposite message — showing 'unverified' after verifying, and vice versa.This PR captures the intended verification state and display label before the API call so the notification always matches the action the user just performed. It also disambiguates the messages to indicate whether the email or phone was verified.
Test Plan
Verified locally by running the check, lint, and unit test suites:
bun run checkbun run lintbun run test:unit(all 235 tests passed successfully)Related PRs and Issues
Resolves #1392
Have you read the Contributing Guidelines on issues?
Yes