AuthInterceptor constructor

AuthInterceptor({
  1. required Future<String?> tokenProvider(),
  2. List<String>? excludePaths,
  3. String authPrefix = 'Bearer',
  4. String headerKey = 'Authorization',
})

Creates an AuthInterceptor.

tokenProvider is the callback to fetch the token. excludePaths is the list of paths to skip authentication. authPrefix is the prefix for the Authorization header. headerKey is the header key for the Authorization header.

Implementation

AuthInterceptor({
  required this.tokenProvider,
  this.excludePaths,
  this.authPrefix = 'Bearer',
  this.headerKey = 'Authorization',
});