push fetch devices and connecting the filters

This commit is contained in:
ashrafzarkanisala
2024-08-24 16:37:10 +03:00
parent 0c047de9c1
commit 2597cdc311
68 changed files with 1800 additions and 989 deletions

View File

@ -22,16 +22,19 @@ class HTTPInterceptor extends InterceptorsWrapper {
if (await validateResponse(response)) {
super.onResponse(response, handler);
} else {
handler.reject(DioException(requestOptions: response.requestOptions, response: response));
handler.reject(DioException(
requestOptions: response.requestOptions, response: response));
}
}
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) async {
void onRequest(
RequestOptions options, RequestInterceptorHandler handler) async {
var storage = const FlutterSecureStorage();
var token = await storage.read(key: Token.loginAccessTokenKey);
if (checkHeaderExclusionListOfAddedParameters(options.path)) {
options.headers.putIfAbsent(HttpHeaders.authorizationHeader, () => "Bearer $token");
options.headers
.putIfAbsent(HttpHeaders.authorizationHeader, () => "Bearer $token");
}
// options.headers['Authorization'] = 'Bearer ${'${token!}123'}';
super.onRequest(options, handler);