mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
OpenAPI: support unsetting auth fields in playground
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'fumadocs-openapi': patch
|
||||
---
|
||||
|
||||
support unsetting auth fields in playground
|
||||
@@ -513,7 +513,8 @@ function useAuthInputs(
|
||||
},
|
||||
mapOutput(out) {
|
||||
if (out && typeof out === 'object') {
|
||||
return `Basic ${btoa(`${'username' in out ? out.username : ''}:${'password' in out ? out.password : ''}`)}`;
|
||||
const obj = out as Record<string, unknown>;
|
||||
return `Basic ${btoa(`${obj.username ?? ''}:${obj.password ?? ''}`)}`;
|
||||
}
|
||||
|
||||
return out;
|
||||
@@ -530,7 +531,6 @@ function useAuthInputs(
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
required: ['username', 'password'],
|
||||
}}
|
||||
fieldName={fieldName}
|
||||
/>
|
||||
@@ -551,7 +551,6 @@ function useAuthInputs(
|
||||
<div className="flex gap-2">
|
||||
<FieldInput
|
||||
fieldName={fieldName}
|
||||
isRequired
|
||||
field={{
|
||||
type: 'string',
|
||||
}}
|
||||
@@ -584,7 +583,6 @@ function useAuthInputs(
|
||||
<FieldSet
|
||||
name={`${t.authorization} (${t.header})`}
|
||||
fieldName={fieldName}
|
||||
isRequired
|
||||
field={{
|
||||
type: 'string',
|
||||
}}
|
||||
@@ -602,7 +600,6 @@ function useAuthInputs(
|
||||
<FieldSet
|
||||
fieldName={fieldName}
|
||||
name={`${security.name} (${security.in})`}
|
||||
isRequired
|
||||
field={{
|
||||
type: 'string',
|
||||
}}
|
||||
@@ -620,7 +617,6 @@ function useAuthInputs(
|
||||
<>
|
||||
<FieldSet
|
||||
name={`${t.authorization} (${t.header})`}
|
||||
isRequired
|
||||
fieldName={fieldName}
|
||||
field={{
|
||||
type: 'string',
|
||||
|
||||
Reference in New Issue
Block a user