Exemple #1
0
 private void OnLoginResponse(LoginResponse response, ErrorResponse error)
 {
     if (error != null)
     {
         if (response.responseCode == LoginResponse.ResponseCode.DownForMaintenance && response.hasAdminAccess)
         {
             // Allow admin user the option to override the maintenance block
             ConfirmDialog.Create(OnOverrideDialogResponse, "Down For Maintenance", error.ToString(), "Override");
         }
         else if (response.responseCode == LoginResponse.ResponseCode.BadVersion)
         {
             // Allow user to update app version
             ConfirmDialog.Create(OnUpdateDialogResponse, "Update Required", error.ToString(), "Download");
         }
         else
         {
             // Other errors that always restore the login screen
             Debug.LogError(error.ToDeveloperMessage(true));
             InfoDialog.Create("", error.ToString(), OnCloseInfoDialog);
         }
     }
     else
     {
         if (!response.emailVerified)
         {
             ConfirmDialog.Create(OnClick_ResendEmail, "Email Not Yet Verified", "Your email has not yet been verified. You must confirm your email address to upload content."
                                  + "\n\nWould you like to resend the confirmation email?", "Resend");
         }
         else
         {
             // Success. Close login dialog.
             OnClick_Close();
         }
     }
 }
Exemple #2
0
        private void OnPasswordRequestResponse(ResetPasswordResponse response, ErrorResponse error)
        {
            m_LoginCanvasGroup.interactable = true;

            if (error == null)
            {
                InfoDialog.Create("Request Sent!", "Reset password email has been sent!", OnCloseInfoDialog);
            }
            else
            {
                // Error occurred
                Debug.LogError(error.ToDeveloperMessage(true));
                InfoDialog.Create("", error.ToString(), OnCloseInfoDialog);
            }
        }
Exemple #3
0
        private void OnCreateAccountResponse(CreateAccountResponse response, ErrorResponse error)
        {
            if (error == null)
            {
                // Success
                InfoDialog.Create("Check your email!",
                                  "Thanks for signing up!\n\nA confirmation email has been sent."
                                  + " Please click the link in the email to activate your account.", OnClick_Close);
            }
            else
            {
                // Error occurred
                m_txtError.text = error.errorMessage;

                m_CanvasGroup.interactable = true;

                Debug.Log(error.ToDeveloperMessage(true));
            }
        }
Exemple #4
0
        private void OnResendEmailResponse(UserAccount.ResendEmailResponseCode code, ErrorResponse error)
        {
            // Log the user out
            AppController.localUser.LogOut((ErrorResponse logoutError) =>
            {
                // Inform user about the email response
                switch (code)
                {
                case UserAccount.ResendEmailResponseCode.Success:
                    InfoDialog.Create("Email Sent", "A confirmation email has been sent. Please check your inbox.", OnCloseInfoDialog);
                    break;

                case UserAccount.ResendEmailResponseCode.AlreadyVerified:
                    InfoDialog.Create("Already Verified", "Email address confirmed. Please log in again.", OnCloseInfoDialog);
                    break;

                default:
                    InfoDialog.Create("", error.ToString(), OnCloseInfoDialog);
                    break;
                }
            });
        }