diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache index e3a5e8243854..02632f0c64c7 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/configuration.mustache @@ -70,9 +70,9 @@ export class {{configurationClassName}} { {{#isBasic}} {{#isBasicBasic}} this.credentials['{{name}}'] = () => { - if (this.username || this.password) { - return btoa(this.username + ':' + this.password); - } + return (this.username || this.password) + ? btoa(this.username + ':' + this.password) + : undefined; }; {{/isBasicBasic}} {{#isBasicBearer}}