question

kevin-6 avatar image
kevin-6 asked

Check if email taken

We're trying to use PlayFabClientAPI.GetAccountInfo() to determine if an account is already taken. This works fine if an account is created using the same title, but if the account is created in a different title under the same studio this call return's an "Account not found" error.

Scenario 1
In Title A Create an account for example@gmail.com
In Title A Attempt to create an account again for example@gmail.com
Call to GetAccountInfo() for example@gmail.com returns an existing account

Scenario 2
In Title A Create an account for example@gmail.com
In Title B Attempt to create an account again for example@gmail.com
Call to GetAccountInfo() for example@gmail.com returns account not found
In Title B Finish account creation, call to AddUsernamePassword() with email = example@gmail.com return account already taken

Is there a different way we can determine if an email is already taken for the master account?

entities
10 |1200

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

jital avatar image
jital answered

Hello,

You can use the RegisterPlayFabUser API call, this will return with the error "Email Address not available: Email address already exists". This error will return if the supplied email is attached to a Master Player account that is apart of the studio regardless of Title.

4 comments
10 |1200

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

kevin-6 avatar image kevin-6 commented ·

Is it possible to determine if the email is taken without actually registering the email?

In our registration flow we first ask the user for their email and then gather information before completing the registration process. It seems weird to register the user before they complete the process.

0 Likes 0 ·
jital avatar image jital ♦ kevin-6 commented ·

Using RegisterPlayFabUser shouldn't affect your flow. If the email entered is not in use the user is registered and the additional information can be added to the account with AddUsernamePassword. If the email is used by any other user in the studio an error is returned.

If this process disrupts your registration flow, would you be able to describe your flow in more detail to resolve this disruption?

0 Likes 0 ·
kevin-6 avatar image kevin-6 commented ·

Here's our account creation screen. Want to signal the user if the account is taken or if they already have an account. In the current flow after the user stops typing we call GetAccountInfo() to determine if the account is taken already.


Again, this call works properly as long as the account was created in the same title. We are just trying to imporve the user experience for some of our cross app users.

0 Likes 0 ·
capture.png (128.9 KiB)
jital avatar image jital ♦ kevin-6 commented ·

From what I can tell from the screenshot here, my above suggestion doesn't break this flow. The only issue is if a user enters an email that is not taken but then changes their mind on which email to use before clicking 'continue'. This would create two accounts which is undesirable.

A way to resolve this problem is to track the valid email addresses the user enters and then once they click 'continue' delete the accounts created with all the older email accounts.

Now, I realize this is not every clean. However something similar to this method is the best way for both checking for used emails across titles and keeping your flow.

0 Likes 0 ·
nannie avatar image
nannie answered

I think instead of using the register API, you can try to call login API with the email and a random password. You will get a similar error (account not found) if the account does not exist :)

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.