TF-2271 Implement dns lookup to get jmap url

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 7b0c0015a15a243b6b4aef3d78e7653d556ad109)
This commit is contained in:
dab246
2023-11-10 17:06:50 +07:00
committed by Dat Vu
parent c0bef69435
commit 9b661b0688
33 changed files with 773 additions and 483 deletions
+27 -21
View File
@@ -141,21 +141,7 @@ abstract class BaseController extends GetxController
);
}
return error;
} else if (error is BadCredentialsException) {
if (currentOverlayContext != null && currentContext != null) {
appToast.showToastErrorMessage(
currentOverlayContext!,
AppLocalizations.of(currentContext!).badCredentials
);
}
return error;
} else if (error is ConnectionError) {
if (authorizationInterceptors.isAppRunning && currentOverlayContext != null && currentContext != null) {
appToast.showToastErrorMessage(
currentOverlayContext!,
AppLocalizations.of(currentContext!).connectionError
);
}
} else if (error is BadCredentialsException || error is ConnectionError) {
return error;
}
@@ -166,6 +152,22 @@ abstract class BaseController extends GetxController
void handleExceptionAction({Failure? failure, Exception? exception}) {
logError('BaseController::handleExceptionAction():failure: $failure | exception: $exception');
if (exception is BadCredentialsException) {
if (currentOverlayContext != null && currentContext != null) {
appToast.showToastErrorMessage(
currentOverlayContext!,
AppLocalizations.of(currentContext!).badCredentials
);
}
} else if (exception is ConnectionError) {
if (currentOverlayContext != null && currentContext != null) {
appToast.showToastErrorMessage(
currentOverlayContext!,
AppLocalizations.of(currentContext!).connectionError
);
}
}
if (!authorizationInterceptors.isAppRunning) {
return;
}
@@ -182,7 +184,7 @@ abstract class BaseController extends GetxController
} else {
await clearDataAndGoToLoginPage();
}
} else if (failure is GetFCMSubscriptionLocalFailure ||
} else if (failure is GetFCMSubscriptionLocalFailure ||
failure is DestroySubscriptionFailure) {
await clearDataAndGoToLoginPage();
}
@@ -326,9 +328,9 @@ abstract class BaseController extends GetxController
log('BaseController::clearDataAndGoToLoginPage:');
await clearAllData();
goToLogin(arguments: LoginArguments(
isAuthenticatedWithOidc
? LoginFormType.ssoForm
: LoginFormType.credentialForm
PlatformInfo.isWeb
? LoginFormType.none
: LoginFormType.dnsLookupForm
));
}
@@ -346,7 +348,9 @@ abstract class BaseController extends GetxController
cachingManager.clearAll(),
languageCacheManager.removeLanguage(),
]);
await cachingManager.clearAllFileInStorage();
if (PlatformInfo.isMobile) {
await cachingManager.clearAllFileInStorage();
}
authorizationInterceptors.clear();
authorizationIsolateInterceptors.clear();
if (_isFcmEnabled) {
@@ -361,7 +365,9 @@ abstract class BaseController extends GetxController
cachingManager.clearAll(),
languageCacheManager.removeLanguage(),
]);
await cachingManager.clearAllFileInStorage();
if (PlatformInfo.isMobile) {
await cachingManager.clearAllFileInStorage();
}
authorizationIsolateInterceptors.clear();
authorizationInterceptors.clear();
if (_isFcmEnabled) {