| 1 | // |
| 2 | // AUTO-GENERATED FILE, DO NOT MODIFY! |
| 3 | // |
| 4 | |
| 5 | import 'package:dio/dio.dart'; |
| 6 | import 'package:openapi/src/auth/auth.dart'; |
| 7 | |
| 8 | class BearerAuthInterceptor extends AuthInterceptor |
| 9 | final Map<String |
| 10 | |
| 11 | @override |
| 12 | void onRequest( |
| 13 | RequestOptions options, |
| 14 | RequestInterceptorHandler handler, |
| 15 | ) { |
| 16 | final authInfo = getAuthInfo(options |
| 17 | for (final info in authInfo) { |
| 18 | final token = tokens[info['name']]; |
| 19 | if (token != null) { |
| 20 | options.headers['Authorization'] = 'Bearer ${token |
| 21 | break; |
| 22 | } |
| 23 | } |
| 24 | super.onRequest(options, handler) |
| 25 | } |
| 26 | } |