mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-04 03:39:37 -05:00 
			
		
		
		
	* optimize android side gradle settings * android minsdk back to 21 * remove unused package, update linter and fix lint error
		
			
				
	
	
		
			17 lines
		
	
	
		
			575 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			575 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
import 'package:dio/dio.dart';
 | 
						|
import 'package:hive_flutter/hive_flutter.dart';
 | 
						|
import 'package:immich_mobile/constants/hive_box.dart';
 | 
						|
 | 
						|
class AuthenticatedRequestInterceptor extends Interceptor {
 | 
						|
  @override
 | 
						|
  void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
 | 
						|
    // debugPrint('REQUEST[${options.method}] => PATH: ${options.path}');
 | 
						|
 | 
						|
    var box = Hive.box(userInfoBox);
 | 
						|
 | 
						|
    options.headers["Authorization"] = "Bearer ${box.get(accessTokenKey)}";
 | 
						|
    options.responseType = ResponseType.plain;
 | 
						|
    return super.onRequest(options, handler);
 | 
						|
  }
 | 
						|
}
 |