Example #1
0
 private static void OnLoginButtonClicked()
 {
     PlayFabEditorApi.Login(new LoginRequest()
     {
         DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
         DeveloperToolProductVersion = PlayFabEditorHelper.EDEX_VERSION,
         Email    = _userEmail,
         Password = _userPass
     }, (result) =>
     {
         PlayFabEditorPrefsSO.Instance.DevAccountToken = result.DeveloperClientToken;
         PlayFabEditorPrefsSO.Instance.DevAccountEmail = _userEmail;
         PlayFabEditorDataService.RefreshStudiosList();
         PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
         PlayFabEditorPrefsSO.Save();
         PlayFabEditorMenu._menuState = PlayFabEditorMenu.MenuStates.Sdks;
     }, (error) =>
     {
         if ((int)error.Error == 1246 || error.ErrorMessage.Contains("TwoFactor"))
         {
             // pop 2FA dialog
             PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnWarning, "This account requires 2-Factor Authentication.");
             activeState = PanelDisplayStates.TwoFactorPrompt;
         }
         else
         {
             PlayFabEditorHelper.SharedErrorCallback(error);
         }
     });
 }
 private static void OnContinueButtonClicked()
 {
     PlayFabEditorApi.Login(new LoginRequest()
     {
         DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
         DeveloperToolProductVersion = PlayFabEditorHelper.GetApiVersion(ApiCategory.editorextensions),
         TwoFactorAuth = _2FaCode,
         Email         = _userEmail,
         Password      = _userPass
     }, (result) =>
     {
         PlayFabEditorPrefsSO.Instance.DevAccountToken = result.DeveloperClientToken;
         PlayFabEditorPrefsSO.Instance.DevAccountEmail = _userEmail;
         PlayFabEditorDataService.RefreshStudiosList();
         PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
         PlayFabEditorPrefsSO.Save();
     }, PlayFabEditorHelper.SharedErrorCallback);
 }
 private static void OnContinueButtonClicked()
 {
     PlayFabEditorApi.Login(new LoginRequest()
     {
         DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
         DeveloperToolProductVersion = PlayFabEditorHelper.EDEX_VERSION,
         TwoFactorAuth = _2FaCode,
         Email         = _userEmail,
         Password      = _userPass
     }, (result) =>
     {
         PlayFabEditorDataService.AccountDetails.devToken = result.DeveloperClientToken;
         PlayFabEditorDataService.AccountDetails.email    = _userEmail;
         PlayFabEditorDataService.RefreshStudiosList();
         PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
         PlayFabEditorDataService.SaveAccountDetails();
         PlayFabEditorMenu._menuState = PlayFabEditorMenu.MenuStates.Sdks;
     }, PlayFabEditorHelper.SharedErrorCallback);
 }