Skip to content

Commit 3213366

Browse files
committed
Added security check for operations
1 parent 6e429b1 commit 3213366

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openapi-typescript-codegen",
3-
"version": "0.26.1",
3+
"version": "0.26.2",
44
"description": "Library that generates Typescript clients based on the OpenAPI specification.",
55
"author": "Ferdi Koomen",
66
"homepage": "https://github.com/ferdikoomen/openapi-typescript-codegen",

src/templates/core/axios/getHeaders.hbs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions, formData?: FormData): Promise<Record<string, string>> => {
2-
const token = await resolve(options, config.TOKEN);
2+
if (options.secured) {
3+
const token = await resolve(options, config.TOKEN);
4+
}
35
const username = await resolve(options, config.USERNAME);
46
const password = await resolve(options, config.PASSWORD);
57
const additionalHeaders = await resolve(options, config.HEADERS);

0 commit comments

Comments
 (0)