fix(llc): add type check in auth_interceptor.dart
Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
@@ -49,10 +49,13 @@ class AuthInterceptor extends Interceptor {
|
|||||||
DioError err,
|
DioError err,
|
||||||
ErrorInterceptorHandler handler,
|
ErrorInterceptorHandler handler,
|
||||||
) async {
|
) async {
|
||||||
ErrorResponse? error;
|
|
||||||
final data = err.response?.data;
|
final data = err.response?.data;
|
||||||
if (data != null) error = ErrorResponse.fromJson(data);
|
if (data == null || data is! Map<String, dynamic>) {
|
||||||
if (error?.code == ChatErrorCode.tokenExpired.code) {
|
return handler.next(err);
|
||||||
|
}
|
||||||
|
|
||||||
|
final error = ErrorResponse.fromJson(data);
|
||||||
|
if (error.code == ChatErrorCode.tokenExpired.code) {
|
||||||
if (_tokenManager.isStatic) return handler.next(err);
|
if (_tokenManager.isStatic) return handler.next(err);
|
||||||
_client.lock();
|
_client.lock();
|
||||||
await _tokenManager.loadToken(refresh: true);
|
await _tokenManager.loadToken(refresh: true);
|
||||||
|
|||||||
Reference in New Issue
Block a user