File tree Expand file tree Collapse file tree
packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -282,20 +282,39 @@ function buildPostmanRequest(
282282 // Basic Auth
283283 if ( a . type === "http" && a . scheme === "basic" ) {
284284 const { username, password } = auth . data [ a . key ] ;
285+
285286 if ( username === undefined || password === undefined ) {
286- otherHeaders . push ( {
287- key : "Authorization" ,
288- value : "Basic BASE_64_ENCODING_OF <client_id:api_key>" ,
289- } ) ;
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+ }
290307 continue ;
291308 }
309+
292310 otherHeaders . push ( {
293311 key : "Authorization" ,
294312 value : `Basic ${ window . btoa ( `${ username } :${ password } ` ) } ` ,
295313 } ) ;
296314 continue ;
297315 }
298316
317+
299318 // API Key
300319 if ( a . type === "apiKey" && a . in === "header" ) {
301320 const { apiKey } = auth . data [ a . key ] ;
You can’t perform that action at this time.
0 commit comments