question

Mustafa Senel avatar image
Mustafa Senel asked

Can't register without an username (e-mail only)

I want players to register only with e-mail and password but when I try this, I get this error on Unity:

/Client/RegisterPlayFabUser: Both username and email are required unless specified with RequireBothUsernameAndEmail

Is there a solution for this?

unity3dAuthentication
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

·
v-humcin avatar image
v-humcin answered

"RequireBothUsernameAndEmail" is a parameter in the RegisterPlayFabUserRequest and is set to true by default. You can add it to your request and set it to false which will allow you to register without a username specified.

RegisterPlayFabUserRequest request = new RegisterPlayFabUserRequest()
{
    Email = "example@me.com",
    Password = "password",
    TitleId = PlayFabSettings.TitleId,
    RequireBothUsernameAndEmail = false
};

You can find more information about it in the documentation: RegisterPlayFabUser

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.