File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/typescript-fetch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,10 +107,18 @@ export class {{classname}} extends runtime.BaseAPI {
107107 { {/headerParams} }
108108 { {#authMethods} }
109109 { {#isBasic} }
110+ { {#isBasicBasic} }
110111 if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
111112 headerParameters[" Authorization" ] = " Basic " + btoa(this.configuration.username + " :" + this.configuration.password);
112113 }
113-
114+ { {/isBasicBasic} }
115+ { {#isBasicBearer} }
116+ // http bearer auth required
117+ if (this.configuration && (this.configuration.accessToken || this.configuration.apiKey)) {
118+ let token = this.configuration.accessToken || this.configuration.apiKey;
119+ headerParameters[" Authorization" ] = `Bearer ${token} `;
120+ }
121+ { {/isBasicBearer} }
114122 { {/isBasic} }
115123 { {#isApiKey} }
116124 { {#isKeyInHeader} }
You can’t perform that action at this time.
0 commit comments