TokenRefreshStrategyImpl constructor
TokenRefreshStrategyImpl({
- required TokenRefreshHandler refreshHandler,
- required TokenExtractor accessTokenExtractor,
- required TokenExtractor refreshTokenExtractor,
- List<
int> successCodes = const [200], - List<
int> refreshCodes = const [401], - Map<
String, String> authTemplate = const {'Authorization' : 'Bearer '}, - int retries = 1,
Creates a TokenRefreshStrategyImpl with the given parameters.
- refreshHandler: The handler function used to perform the token refresh.
- accessTokenExtractor: The function used to extract the access token from the response.
- refreshTokenExtractor: The function used to extract the refresh token from the response.
- successCodes: The list of status codes indicating a successful token refresh. Default is
200
. - refreshCodes: The list of status codes indicating the need to refresh the token. Default is
401
. - authTemplate: The template for the authorization headers. Default is {'Authorization': 'Bearer '}.
- retries: The number of retry attempts for refreshing the token. Default is 1.
Implementation
TokenRefreshStrategyImpl({
required this.refreshHandler,
required this.accessTokenExtractor,
required this.refreshTokenExtractor,
this.successCodes = const [200],
this.refreshCodes = const [401],
this.authTemplate = const {'Authorization': 'Bearer '},
this.retries = 1,
});