Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Typescript-node does not apply basic auth with blank username or password #5446

Open
Erikmolin opened this issue Feb 26, 2020 · 1 comment

Comments

@Erikmolin
Copy link
Contributor

Description

Using Basic auth should be possible with empty username, however, 4.3.3 generates this code:

  let authenticationPromise = Promise.resolve();
        if (this.authentications.BasicAuth.username && this.authentications.BasicAuth.password) {
            authenticationPromise = authenticationPromise.then(() => this.authentications.BasicAuth.applyToRequest(localVarRequestOptions));
        }

since "" is falsy, auth is never applied if either username or password is empty.

openapi-generator version

Worked in 4.2.2, fails in 4.2.3. Introduced by #4896

OpenAPI declaration file content or url

N/A

Command line used for generation

openapi-generator generate -i api.yaml -g typescript-node --additional-properties=supportsES6=true

Related issues/PRs

introduced by #4896

@auto-labeler
Copy link

auto-labeler bot commented Feb 26, 2020

👍 Thanks for opening this issue!
🏷 I have applied any labels matching special text in your issue.

The team will review the labels and make any necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant