From 8b3a175ead485258d09349bf5390b089b90a1b0d Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Wed, 16 Jun 2021 20:10:08 +0300 Subject: [PATCH] Improve authenticated handling --- lib/core/context/tb_context.dart | 4 ++-- pubspec.lock | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/context/tb_context.dart b/lib/core/context/tb_context.dart index 335c820..bb094a3 100644 --- a/lib/core/context/tb_context.dart +++ b/lib/core/context/tb_context.dart @@ -252,8 +252,7 @@ class TbContext { try { log.debug('onUserLoaded: isAuthenticated=${tbClient.isAuthenticated()}'); isUserLoaded = true; - _isAuthenticated.value = tbClient.isAuthenticated(); - if (isAuthenticated) { + if (tbClient.isAuthenticated()) { log.debug('authUser: ${tbClient.getAuthUser()}'); if (tbClient.getAuthUser()!.userId != null) { try { @@ -269,6 +268,7 @@ class TbContext { homeDashboard = null; oauth2ClientInfos = await tbClient.getOAuth2Service().getOAuth2Clients(pkgName: packageName, platform: _oauth2PlatformType); } + _isAuthenticated.value = tbClient.isAuthenticated(); await updateRouteState(); } catch (e, s) { diff --git a/pubspec.lock b/pubspec.lock index f9d3806..2b27380 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -465,7 +465,7 @@ packages: description: path: "." ref: HEAD - resolved-ref: c2a264d646ebad8ade84abe6c38b78001bd34ed7 + resolved-ref: a899f22d6cd784c72df7abcf42ff190b9d227ee5 url: "git@github.com:thingsboard/dart_thingsboard_client.git" source: git version: "1.0.0"