feature(collections): Заготовка под апи. Переключалка коллекций
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:dio_smart_retry/dio_smart_retry.dart';
|
||||
import 'package:remever/common/functions.dart';
|
||||
import 'package:remever/common/resources.dart';
|
||||
import 'package:remever/common/storage.dart';
|
||||
import 'package:talker_dio_logger/talker_dio_logger_interceptor.dart';
|
||||
import 'package:talker_dio_logger/talker_dio_logger_settings.dart';
|
||||
|
||||
@@ -17,17 +19,17 @@ InterceptorsWrapper get _auth {
|
||||
RequestOptions options,
|
||||
RequestInterceptorHandler handler,
|
||||
) async {
|
||||
// try {
|
||||
// String? token = await authSecStorage.read(key: StorageKeys.authToken);
|
||||
try {
|
||||
String? token = await authSecStorage.read(key: StorageKeys.accessToken);
|
||||
|
||||
// if (token != null) {
|
||||
// options.headers['Authorization'] = 'Bearer $token';
|
||||
// }
|
||||
// } catch (e) {
|
||||
// getIt<LogService>().log(
|
||||
// entity: LogEntity.error(message: 'Error to load access token $e'),
|
||||
// );
|
||||
// }
|
||||
if (token != null) {
|
||||
options.headers['Authorization'] = 'Bearer $token';
|
||||
}
|
||||
} catch (e) {
|
||||
// getIt<LogService>().log(
|
||||
// entity: LogEntity.error(message: 'Error to load access token $e'),
|
||||
// );
|
||||
}
|
||||
|
||||
return handler.next(options);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user