question

gamelords890 avatar image
gamelords890 asked

cant register with other accounts

i followed a playfab auth tutorial and it worked pretty well but i cant seem to register with any other accounts, only 1 account of mine is able to login while i get this error when trying to login with any other (existing) gmail accounts /Client/LoginWithEmailAddress: User not found

some parts of my script:

    public void OnClickLogin()
    {
        var request = new LoginWithEmailAddressRequest { Email = userEmail, Password = userPass };
        PlayFabClientAPI.LoginWithEmailAddress(request, OnLoginSuccess, OnError);
    }


    void OnLoginSuccess(LoginResult result)
    {
        PlayerPrefs.SetString("EMAIL", userEmail);
        PlayerPrefs.SetString("USERNAME", username2);
        PlayerPrefs.SetString("PASSWORD", userPass);
        loginPanel.SetActive(false);
        MenuManager.Instance.OpenMenu("title");
    }

    void OnLoginFailure(PlayFabError error)
    {
        var registerRequest = new RegisterPlayFabUserRequest { Email = userEmail, Password = userPass, Username = username2 };
        PlayFabClientAPI.RegisterPlayFabUser(registerRequest, OnRegisterSuccess, OnRegisterFailure);
    }


    void OnRegisterSuccess(RegisterPlayFabUserResult result)
    {
        Debug.Log("successfully registered");
        PlayerPrefs.SetString("EMAIL", userEmail);
        PlayerPrefs.SetString("PASSWORD", userPass);
        PlayerPrefs.SetString("USERNAME", username2);
        loginPanel.SetActive(false);
        MenuManager.Instance.OpenMenu("title");
    }


    void OnRegisterFailure(PlayFabError error)
    {
        Debug.Log("failed to register");
        Debug.LogError(error.GenerateErrorReport());
    }


Authentication
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

·
Made Wang avatar image
Made Wang answered

In line 4, the error callback for the login request is OnError, and the function on line 17 is OnLoginFailure, which means the register process will never start. Please correct the function name for the error callback.

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.