mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-20 01:25:16 +00:00
Fix OpenAPI basic auth placeholder (#3816)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@gitbook/react-openapi': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix OpenAPI basic auth placeholder
|
||||||
@@ -315,11 +315,12 @@ function getSecurityHeaders(args: {
|
|||||||
switch (security.type) {
|
switch (security.type) {
|
||||||
case 'http': {
|
case 'http': {
|
||||||
let scheme = security.scheme;
|
let scheme = security.scheme;
|
||||||
|
const defaultPlaceholderValue = scheme?.toLowerCase()?.includes('basic')
|
||||||
|
? 'username:password'
|
||||||
|
: 'YOUR_SECRET_TOKEN';
|
||||||
const format = resolvePrefillCodePlaceholderFromSecurityScheme({
|
const format = resolvePrefillCodePlaceholderFromSecurityScheme({
|
||||||
security: security,
|
security: security,
|
||||||
defaultPlaceholderValue: scheme?.includes('basic')
|
defaultPlaceholderValue,
|
||||||
? 'username:password'
|
|
||||||
: 'YOUR_SECRET_TOKEN',
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (scheme?.includes('bearer')) {
|
if (scheme?.includes('bearer')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user