question

Juan Felipe Medrano avatar image
Juan Felipe Medrano asked

How to prevent players from using wrong email

Is there a way to prevent players from registering an account with an email that is not theirs?

for example, let's say a player mistypes the email, but the wrongly written email actually exists, thus registering the account with the wrong email. how could i stop this from happening?

Player DataAccount Management
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

PlayFab doesn’t provide a built-in method to verify the players’ login emails. One workaround to ensure the players use the real email is not to use the login emails and only adding the contact email addresses for players. Please follow this documentation – Using a Rule to Verify a Contact Email Address to set the rule to verify the players’ contact emails. Then you can follow the steps below to set up the clients’ login flow.

  1. Provide the UI for players to enter the username, email, and the password to register the account. Call the Client API RegisterPlayFabUser to register its username and password and call the Client API AddOrUpdateContactEmail to add its email as the player’s contact email.
  2. The rules you set up above will send an email to the player's contact email. Prompt players to check the confirmation email and provide a button, such as "verified", for them to click.
  3. When the button is clicked, you can call the Client API GetPlayerProfile to check the verification status of users’ contact emails.
  4. If the response of API GetPlayerProfile shows the verification status is “verified”, tell the players the registration is complete. Otherwise, tell them, they need to enter the correct email addresses and verified it again.
  5. To modify the player’s contact email, you can call the Client API RemoveContactEmail to remove it and call the API AddOrUpdateContactEmail to add it again.

In this way, players can log in to your title using their username and password and their contact emails always need to be verified. The contact emails can be used to receive the email notifications and recovery the player account, you can check this documentation – Using Email Templates for more information.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.