TF-1317 Update authentication account to store AccountId

This commit is contained in:
dab246
2023-01-04 19:00:53 +07:00
committed by Dat H. Pham
parent eadc0c4ddc
commit 6566372337
21 changed files with 193 additions and 71 deletions
@@ -88,13 +88,18 @@ class AuthorizationInterceptors extends InterceptorsWrapper {
_configOIDC!.scopes,
_token!.refreshToken);
final accountCurrent = await _accountCacheManager.getSelectedAccount();
await Future.wait([
_tokenOidcCacheManager.persistOneTokenOidc(newToken),
_accountCacheManager.deleteSelectedAccount(_token!.tokenIdHash),
_accountCacheManager.setSelectedAccount(Account(
newToken.tokenIdHash,
AuthenticationType.oidc,
isSelected: true)),
newToken.tokenIdHash,
AuthenticationType.oidc,
isSelected: true,
accountId: accountCurrent.accountId,
apiUrl: accountCurrent.apiUrl
)),
]);
log('AuthorizationInterceptors::onError(): refreshToken: $newToken');