question

Gordon Graber avatar image
Gordon Graber asked

register with different email using PlayFab sample: user already linked to different account

I'm trying to understand why this error occurs - it doesn't make sense to me.

I'm using the Unity PlayFab login sample project on github, which attempts to register the user if the supplied email and password isn't successful.

I'm doing this all on one computer in successive test runs of the Unity Project:


1. I play the project and I enter a email and password the first time, and it works - I can see the user created in the studio manager panel.

2. I quit the test,and then I clear the player prefs (not sure if any have been saved, but just for good measure)

3. I play the project again.

4. Now, I go to enter a completely different email and attempt to register, and the code generates the error: user already linked to different account

Why is this happening?

Player Data
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

·
Citrus Yan avatar image
Citrus Yan answered

May I know which sample project are you using (the link)?

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.

Gordon Graber avatar image Gordon Graber commented ·

It's the PlayFabAuthentication sample at this link:

https://github.com/PlayFab/PlayFab-Samples/tree/master/VideoTutorialSamples

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Gordon Graber commented ·

Just did a test on this project. Here is the explanation for this behavior:

First it calls LoginWithEmailAddress to log in, if the email entered does not exist, it will call LoginWithCustomId to login the player using the customid generated by the program and after that it calls AddUsernamePassword to add the email and password for it.

The second time you enter a different email, it will repeat the above process, however this time, it's logged into the same account using the same custom id used before, that's why you're getting the "User already linked to a different account" error when calling AddUsernamePassword.

0 Likes 0 ·
Gordon Graber avatar image Gordon Graber Citrus Yan commented ·

Thanks for your help! I just wanted to make sure I had it set up properly, or something was missing, or what.

That's kind of what I suspected, but I thought it would only do that if you checked "remember me." Being new to PlayFab, I did not follow the code through all the way through.

Just to clarify:

So it is saving a custom id on the local machine, and that ID used instead of the users email on subsequent logins?

I know that is how the designer set this up, but the logic seems a bit strange to not allow different users to login on the same machine.

Is there some reason for designing it that way, or it was merely an arbitrary choice?

0 Likes 0 ·
Show more comments

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.