applyToParams method
Apply authentication settings to header and query params.
Implementation
@override
void applyToParams(List<MmQueryParam> queryParams, Map<String, String> headerParams) {
if (_accessToken == null) {
return;
}
String accessToken;
if (_accessToken is String) {
accessToken = _accessToken;
} else if (_accessToken is MmHttpBearerAuthProvider) {
accessToken = _accessToken!();
} else {
return;
}
if (accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken';
}
}