From a59656184f9ef4fea945fab87a7fb7bf1adbd093 Mon Sep 17 00:00:00 2001 From: Sikander Saleem Date: Thu, 26 Jan 2023 11:03:05 +0300 Subject: [PATCH] session log out check change. --- lib/api/api_client.dart | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/api/api_client.dart b/lib/api/api_client.dart index 1a70428..8518cd7 100644 --- a/lib/api/api_client.dart +++ b/lib/api/api_client.dart @@ -87,13 +87,12 @@ class ApiClient { if (!kReleaseMode) { logger.i("res: " + response.body); } + var jsonData = jsonDecode(response.body); - if (jsonData["MessageStatus"] == 2) { - AppState().setIsAuthenticated = false; + if (jsonData["IsAuthenticated"] != null) { + AppState().setIsAuthenticated = jsonData["IsAuthenticated"]; } - - - if (jsonData["ErrorMessage"] == null && jsonData["MessageStatus"] == 1) { + if (jsonData["ErrorMessage"] == null) { return factoryConstructor(jsonData); } else { APIError? apiError;