Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Inconsistency in User Verification Status between Email and Phone Number #1392

Open
2 tasks done
gurjeetsinghvirdee opened this issue Apr 17, 2024 · 6 comments
Labels
bug Something isn't working good first issue Good for newcomers product / auth Fixes and upgrades for the Appwrite Auth

Comments

@gurjeetsinghvirdee
Copy link

👟 Reproduction steps

  • To trigger this bug, begin by accessing the Auth,
  • Create a new user account and navigate to the user profile to verify the account.
  • Start the verification process for both the email address and the phone number associated with the user account. Initially, verify the email address, which should proceed smoothly.
  • Next, attempt to verify the phone number, Despite the successful verification of the email address, the system incorrectly indicates that the user is unverified when verifying the phone number.
  • In an attempt to rectify this inconsistency, proceed to unverify the phone number. Unexpectedly, the system now displays an alert indicating that the user is verified, contradicting the initial indication of being unverified.

👍 Expected behavior

  • When the user hits Verify Phone, the alert should confirm that the user is verified.
  • When the user hits Unverify Phone, the alert should confirm that the user is unverified.

👎 Actual Behavior

When attempting to verify the phone number, an alert incorrectly states that the user is unverified.
However, when attempting to unverify the phone, the system incorrectly indicates that the user is verified.

🎲 Appwrite version

Version 1.4.x

💻 Operating system

Windows

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@gurjeetsinghvirdee gurjeetsinghvirdee added the bug Something isn't working label Apr 17, 2024
@gurjeetsinghvirdee
Copy link
Author

bug.mp4

@ItzNotABug
Copy link
Member

Reproducible on 1.5.4 too.

@stnguyen90 stnguyen90 self-assigned this Apr 22, 2024
@stnguyen90 stnguyen90 added the product / auth Fixes and upgrades for the Appwrite Auth label Apr 22, 2024
@stnguyen90
Copy link
Contributor

@gurjeetsinghvirdee, thanks for raising this issue! 🙏🏼 Let me confirm with the team.

@stnguyen90 stnguyen90 transferred this issue from appwrite/appwrite Oct 3, 2024
@stnguyen90
Copy link
Contributor

stnguyen90 commented Oct 3, 2024

We want to update the alerts to be specific to say:

XYZ's email has been verified
XYZ's email has been unverified
XYZ's phone has been verified
XYZ's phone has been unverified

Note

The "s" should only be there if the name does not end with s. For example, if the user's name was "Charles", it should be "Charles' email has been verified"

FYI, the code that needs to be updated is here:

async function updateVerificationEmail() {
showVerifcationDropdown = false;
try {
await sdk.forProject.users.updateEmailVerification($user.$id, !$user.emailVerification);
await invalidate(Dependencies.USER);
addNotification({
message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${
!$user.emailVerification ? 'unverified' : 'verified'
}`,
type: 'success'
});
trackEvent(Submit.UserUpdateVerificationEmail);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdateVerificationEmail);
}
}
async function updateVerificationPhone() {
showVerifcationDropdown = false;
try {
await sdk.forProject.users.updatePhoneVerification($user.$id, !$user.phoneVerification);
await invalidate(Dependencies.USER);
addNotification({
message: `${$user.name || $user.email || $user.phone || 'The account'} has been ${
$user.phoneVerification ? 'unverified' : 'verified'
}`,
type: 'success'
});
trackEvent(Submit.UserUpdateVerificationPhone);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
trackError(error, Submit.UserUpdateVerificationPhone);
}
}

@pushkar707
Copy link
Contributor

Hi, assuming that the previous PR has some issues since it hasn't been merged so far. Can I take over this issue?

@gurjeetsinghvirdee
Copy link
Author

@pushkar707
Since it doesn't merge that doesn't mean the PR have issues, PRs been merged according to the priority level!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers product / auth Fixes and upgrades for the Appwrite Auth
Projects
None yet
Development

No branches or pull requests

4 participants