diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 8d0daf61cab..b903769d8a3 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -113,8 +113,8 @@ export class {{classname}} extends runtime.BaseAPI { } {{/isBasicBasic}} {{#isBasicBearer}} - if (this.configuration && (this.configuration.accessToken || this.configuration.apiKey)) { - const token = this.configuration.accessToken || this.configuration.apiKey; + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("{{name}}", [{{#scopes}}"{{{scope}}}"{{^-last}}, {{/-last}}{{/scopes}}]) : token; if (tokenString) {