Skip to content

Instantly share code, notes, and snippets.

@shiburagi
Last active July 30, 2021 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shiburagi/f3ba03d5a6ad56ce6dcb865b65b823aa to your computer and use it in GitHub Desktop.
Save shiburagi/f3ba03d5a6ad56ce6dcb865b65b823aa to your computer and use it in GitHub Desktop.
import 'package:dio/dio.dart';
class AppInteceptor extends Interceptor {
@override
void onRequest(RequestOptions options, RequestInterceptorHandler handler) {
options.headers.addAll({"Authorization": "bearer {{TOKEN}}"});
super.onRequest(options, handler);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment