Improve authenticated handling

This commit is contained in:
Igor Kulikov
2021-06-16 20:10:08 +03:00
parent a58d8c5b49
commit 8b3a175ead
2 changed files with 3 additions and 3 deletions

View File

@@ -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) {