fix(mobile): ios random logout (#8997)

* fix(mobile): random logout

* move logout mechanism to the end

* More logs

* wording

* more logs

* fixed

* Better check
This commit is contained in:
Alex 2024-04-23 16:09:10 -05:00 committed by GitHub
parent 70c78a09a4
commit 48b0b7e8bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 70 additions and 25 deletions

View file

@ -181,10 +181,21 @@ class AuthenticationNotifier extends StateNotifier<AuthenticationState> {
UserResponseDto? userResponseDto;
try {
userResponseDto = await _apiService.userApi.getMyUserInfo();
} on ApiException catch (e) {
if (e.innerException is SocketException) {
} on ApiException catch (error, stackTrace) {
_log.severe(
"Error getting user information from the server [API EXCEPTION]",
error,
stackTrace,
);
if (error.innerException is SocketException) {
state = state.copyWith(isAuthenticated: true);
}
} catch (error, stackTrace) {
_log.severe(
"Error getting user information from the server [CATCH ALL]",
error,
stackTrace,
);
}
if (userResponseDto != null) {