TF-1829 Fix app crash upon 401
(cherry picked from commit 8906322f932c4e1edadaf3f1831fc533fddd9a8b)
This commit is contained in:
@@ -121,7 +121,8 @@ abstract class BaseController extends GetxController
|
||||
|
||||
Exception? _performFilterExceptionInError(dynamic error) {
|
||||
logError('BaseController::_performFilterExceptionInError(): $error');
|
||||
if (error is NoNetworkError || error is ConnectError || error is InternalServerError) {
|
||||
if (error is NoNetworkError || error is ConnectionTimeout || error is InternalServerError) {
|
||||
logError('BaseController::_performFilterExceptionInError(): NoNetworkError');
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastMessage(
|
||||
currentOverlayContext!,
|
||||
@@ -136,6 +137,7 @@ abstract class BaseController extends GetxController
|
||||
}
|
||||
return error;
|
||||
} else if (error is BadCredentialsException) {
|
||||
logError('BaseController::_performFilterExceptionInError(): BadCredentialsException');
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastErrorMessage(
|
||||
currentOverlayContext!,
|
||||
@@ -143,6 +145,15 @@ abstract class BaseController extends GetxController
|
||||
}
|
||||
performInvokeLogoutAction();
|
||||
return error;
|
||||
} else if (error is ConnectionError) {
|
||||
logError('BaseController::_performFilterExceptionInError(): ConnectionError');
|
||||
if (currentOverlayContext != null && currentContext != null) {
|
||||
_appToast.showToastErrorMessage(
|
||||
currentOverlayContext!,
|
||||
AppLocalizations.of(currentContext!).connectionError);
|
||||
}
|
||||
performInvokeLogoutAction();
|
||||
return error;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -306,6 +317,7 @@ abstract class BaseController extends GetxController
|
||||
}
|
||||
|
||||
void performInvokeLogoutAction() {
|
||||
log('BaseController::performInvokeLogoutAction():');
|
||||
if (isAuthenticatedWithOidc) {
|
||||
_logoutOIDCAction();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user