1.0.0
This commit is contained in:
commit
f076ae3790
82 changed files with 7250 additions and 0 deletions
18
lib/src/auth/auth.dart
Normal file
18
lib/src/auth/auth.dart
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
abstract class AuthInterceptor extends Interceptor {
|
||||
/// Get auth information on given route for the given type.
|
||||
/// Can return an empty list if type is not present on auth data or
|
||||
/// if route doesn't need authentication.
|
||||
List<Map<String, String>> getAuthInfo(RequestOptions route, bool Function(Map<String, String> secure) handles) {
|
||||
if (route.extra.containsKey('secure')) {
|
||||
final auth = route.extra['secure'] as List<Map<String, String>>;
|
||||
return auth.where((secure) => handles(secure)).toList();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue