From ba4663257d78316a6967750c4680b94cc9a86dfd Mon Sep 17 00:00:00 2001 From: dab246 Date: Mon, 13 Jun 2022 18:02:06 +0700 Subject: [PATCH] TF-644 Remove 401 error when refreshToken --- .../login/data/network/config/authorization_interceptors.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/features/login/data/network/config/authorization_interceptors.dart b/lib/features/login/data/network/config/authorization_interceptors.dart index 0b98b536e..23c0c1b77 100644 --- a/lib/features/login/data/network/config/authorization_interceptors.dart +++ b/lib/features/login/data/network/config/authorization_interceptors.dart @@ -77,7 +77,8 @@ class AuthorizationInterceptors extends InterceptorsWrapper { void onError(DioError err, ErrorInterceptorHandler handler) async { final requestOptions = err.requestOptions; log('AuthorizationInterceptors::onError(): $err'); - if ((_isTokenExpired() || err.response?.statusCode == 401) && + if (_isTokenExpired() && + err.response?.statusCode == 401 && _isAuthenticationOidcValid()) { try { final newToken = await _authenticationClient.refreshingTokensOIDC(