question

Jay avatar image
Jay asked

Does LoginWithEmailAddress create accounts?

One of the return fields from LoginWithEmailAddress is called NewlyCreated, documented that this will be true if the account was newly created on this login. Does this mean that you can do an automatic registration/login rather than try login, if fail, register approach?

I have tried this but I get the 1001 error - account not found. So is it actually possible or not?

I'm getting frustrated with the documentation, is it out of date, or contains legacy things that should be marked as deprecated? I'm newly learning to use PlayFab so it is hard to get any context for some of this stuff. I need to be able to trust the documentation.

 

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

·
brendan avatar image
brendan answered

No, the reason NewlyCreated is there is because the response class for all the login calls is the same, so please ignore it for that, and the LoginWithPlayFab calls. The path to creating an account with username/password or email/password is to use RegisterPlayFabUser. I realize this is different from the pattern in the other calls, and we may well update to a new API which aligns to the other pattern in future, but for now, that's the flow for that type of account creation.

9 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.

nickpruehs avatar image nickpruehs commented ·

Actually, I'd love to follow up on this one. As there is no automatic way of clearing all user accounts for an existing title, we have created a new title as suggested throughout the forums. We are using the Unreal PlayFab integration and calling LoginWithEmailAddress. For our new title (10E3), that silently caused a new account to be created instead of returning error 1001. Is this the new intended behaviour? How can we prevent that?

0 Likes 0 ·
brendan avatar image brendan nickpruehs commented ·

LoginWithEmailAddress cannot create a player account. I just re-tested this in Postman, and got:

{
    "code": 401,
    "status": "Unauthorized",
    "error": "AccountNotFound",
    "errorCode": 1001,
    "errorMessage": "User not found"
}

If you believe you're seeing something different, can you post specifics of the Title ID, a PlayFab ID of a user you believe was created this way, and the specific parameters you are passing into the call?

0 Likes 0 ·
nickpruehs avatar image nickpruehs brendan commented ·

Hey @Brendan, still for title 10E3, the user 706B0C7037AFBBAC was "created" just by calling LoginWithPlayFab. The user exists for another title, A821, and thus was able to sign in without any explicit signup. Is there any way to prevent this? We have set up an automation rule "InitializePlayer" triggered by "com.playfab.player_added_title" which wasn't fully executed for that user for the new title. That automation rule sets up some crucial initial values for our game.

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.