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(); } } }
public static InfoDialog Create(string title, string body, OnDialogCallback cb = null) { GameObject goDlg = Instantiate(Resources.Load <GameObject>("Dialogs/CanvasInfoDialog")); InfoDialog dlg = goDlg.GetComponent <InfoDialog>(); dlg.Initialize(title, body, cb); return(dlg); }
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); } }
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)); } }
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; } }); }