dart2-v3template.auth.oauth.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of connect-openapi-dart Show documentation
Show all versions of connect-openapi-dart Show documentation
dart2 generator from openapi 3.x spec files. Changing to openapitools dependencies.
part of {{pubName}}.api;
class OAuth implements Authentication {
String _accessToken;
OAuth({String accessToken}) : _accessToken = accessToken;
@override
void applyToParams(List queryParams, Map headerParams) {
if (_accessToken != null) {
headerParams["Authorization"] = "Bearer $_accessToken";
}
}
set accessToken(String accessToken) => _accessToken = accessToken;
}