void OnAuthError(object sender, AuthErrorType authErrorType) { _viewModel.Cleanup(); Debug.Print("OnAuthError"); LogInWithIDPortenBtn.HideSpinner(); Utils.AuthErrorUtils.GoToErrorPageForAuthErrorType(this, authErrorType); _authViewController.DismissViewController(true, null); }
void OnAuthError(object sender, AuthErrorType authErrorType) { _viewModel.Cleanup(); Debug.Print("OnAuthError"); LogUtils.LogMessage(LogSeverity.INFO, "Authentication failed."); LogInWithIDPortenBtn.HideSpinner(); Utils.AuthErrorUtils.GoToErrorPageForAuthErrorType(this, authErrorType); _authViewController.DismissViewController(true, null); }
// Firebase should really have something built in so I didn't need to do this.. // If they add it in a future version this function may be removed private static AuthErrorType ConvertToAuthError(string errorMessage) { AuthErrorType errorType = AuthErrorType.ERROR_UNKNOWN; for (int i = 0; i < staticRef.authErrorMessages.Length; i++) { if (errorMessage == staticRef.authErrorMessages[i]) { errorType = (AuthErrorType)i; } } return(errorType); }
public static void GoToErrorPageForAuthErrorType(UIViewController parent, AuthErrorType authErrorType) { AuthException authException = new AuthException(authErrorType.ToString()); switch (authErrorType) { case AuthErrorType.MaxTriesExceeded: GoToManyTriesError(parent, LogSeverity.WARNING, authException, "Max number of tries was exceeded"); break; case AuthErrorType.NotInfected: GoToNotInfectedError(parent, LogSeverity.WARNING, authException, "User is not infected"); break; case AuthErrorType.Unknown: GoToTechnicalError(parent, LogSeverity.WARNING, authException, "User sees Technical error page after ID Porten login: Unknown auth error or user press backbtn"); break; } }
//After calling this method you cannot return by going "Back". //OnCreate has to be called again if returning to this page. void GoToErrorPage(AuthErrorType error) { _viewModel.Cleanup(); RunOnUiThread(() => { switch (error) { case AuthErrorType.MaxTriesExceeded: AuthErrorUtils.GoToManyTriesError(this, LogSeverity.WARNING, null, "Max number of tries was exceeded"); break; case AuthErrorType.NotInfected: AuthErrorUtils.GoToNotInfectedError(this, LogSeverity.WARNING, null, "User is not infected"); break; case AuthErrorType.Unknown: AuthErrorUtils.GoToTechnicalError(this, Enums.LogSeverity.WARNING, null, "User sees Technical error page after ID Porten login: Unknown auth error or user press backbtn"); break; } }); }
private void OnAuthError(object sender, AuthErrorType e) { LogUtils.LogMessage(LogSeverity.INFO, $"Authentication failed."); GoToErrorPage(e); }
private void OnAuthError(object sender, AuthErrorType e) { GoToErrorPage(e); }