Skip to content

Commit 7493aba

Browse files
committed
initial commit
1 parent ad84ffe commit 7493aba

1 file changed

Lines changed: 5 additions & 23 deletions

File tree

packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/buildPostmanRequest.ts

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -279,42 +279,24 @@ function buildPostmanRequest(
279279
continue;
280280
}
281281

282+
// Basic Auth
282283
// Basic Auth
283284
if (a.type === "http" && a.scheme === "basic") {
284285
const { username, password } = auth.data[a.key];
285-
286286
if (username === undefined || password === undefined) {
287-
// Dynamic scheme-based header fallback
288-
switch (a.key) {
289-
case "MD-SESSION-TOKEN":
290-
otherHeaders.push({
291-
key: "MD-SESSION-TOKEN",
292-
value: "<SESSION_TOKEN_VALUE>",
293-
});
294-
break;
295-
case "MD-API-TOKEN":
296-
otherHeaders.push({
297-
key: "MD-API-TOKEN",
298-
value: "<API_KEY_VALUE>",
299-
});
300-
break;
301-
default:
302-
otherHeaders.push({
303-
key: "Authorization",
304-
value: "Basic BASE_64_ENCODING_OF{client_id:api_key}",
305-
});
306-
}
287+
otherHeaders.push({
288+
key: "Authorization",
289+
value: "Basic <BASE64_ENCODED_CREDENTIALS>",
290+
});
307291
continue;
308292
}
309-
310293
otherHeaders.push({
311294
key: "Authorization",
312295
value: `Basic ${window.btoa(`${username}:${password}`)}`,
313296
});
314297
continue;
315298
}
316299

317-
318300
// API Key
319301
if (a.type === "apiKey" && a.in === "header") {
320302
const { apiKey } = auth.data[a.key];

0 commit comments

Comments
 (0)