From 98206bf7a58206ce3cf754aaaa420c90b6083fd2 Mon Sep 17 00:00:00 2001 From: v1nayG Date: Wed, 10 Jun 2026 11:11:39 +0530 Subject: [PATCH] fix(auth): correct verification alert messages for email and phone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../auth/user-[user]/updateStatus.svelte | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte index ffbd35e642..7340bd55f3 100644 --- a/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte +++ b/src/routes/(console)/project-[region]-[project]/auth/user-[user]/updateStatus.svelte @@ -17,18 +17,18 @@ async function updateVerificationEmail() { showVerificationDropdown = false; + const newVerification = !$user.emailVerification; + const label = $user.name || $user.email || $user.phone || 'The account'; try { await sdk .forProject(page.params.region, page.params.project) .users.updateEmailVerification({ userId: $user.$id, - emailVerification: !$user.emailVerification + emailVerification: newVerification }); await invalidate(Dependencies.USER); addNotification({ - message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${ - !$user.emailVerification ? 'unverified' : 'verified' - }`, + message: `${label} email has been ${newVerification ? 'verified' : 'unverified'}`, type: 'success' }); trackEvent(Submit.UserUpdateVerificationEmail); @@ -42,18 +42,18 @@ } async function updateVerificationPhone() { showVerificationDropdown = false; + const newVerification = !$user.phoneVerification; + const label = $user.name || $user.email || $user.phone || 'The account'; try { await sdk .forProject(page.params.region, page.params.project) .users.updatePhoneVerification({ userId: $user.$id, - phoneVerification: !$user.phoneVerification + phoneVerification: newVerification }); await invalidate(Dependencies.USER); addNotification({ - message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${ - $user.phoneVerification ? 'unverified' : 'verified' - }`, + message: `${label} phone has been ${newVerification ? 'verified' : 'unverified'}`, type: 'success' }); trackEvent(Submit.UserUpdateVerificationPhone);