Fix OpenAPI basic auth placeholder (#3816)

This commit is contained in:
Nolann B.
2025-11-18 20:18:59 +01:00
committed by GitHub
parent 854e612e5d
commit 3e40b4db50
2 changed files with 9 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': patch
---
Fix OpenAPI basic auth placeholder
@@ -315,11 +315,12 @@ function getSecurityHeaders(args: {
switch (security.type) {
case 'http': {
let scheme = security.scheme;
const defaultPlaceholderValue = scheme?.toLowerCase()?.includes('basic')
? 'username:password'
: 'YOUR_SECRET_TOKEN';
const format = resolvePrefillCodePlaceholderFromSecurityScheme({
security: security,
defaultPlaceholderValue: scheme?.includes('basic')
? 'username:password'
: 'YOUR_SECRET_TOKEN',
defaultPlaceholderValue,
});
if (scheme?.includes('bearer')) {