-
-
Notifications
You must be signed in to change notification settings - Fork 272
Closed
Labels
bug 🔥Something isn't workingSomething isn't working
Description
Description
See https://swagger.io/specification/#security-requirement-object
and see
openapi-ts/packages/client-fetch/src/utils.ts
Line 226 in 8170abe
| return; |
Only the first matching security will be considered thus it omits the second auth.
const client = createClient(
createConfig({
baseUrl,
headers,
auth: (auth) => {
console.log('Auth is asking for', { auth });
if (auth.name === 'Authorization') {
return 'blabliblub'
} else if (auth.name === 'another') {
return 'this is never happening';
}
},
}),
);For the moment I used patch-package again to get rid of the early return statement from utils.ts#L226:
https://gist.github.com/AmazingTurtle/8e55f199fbed3fae6959dc0d4ab862b8
Reproducible example or configuration
No response
OpenAPI specification (optional)
[...]
"security": [
{
"bearer": [],
"another": []
}
],
[...]System information (optional)
No response
Metadata
Metadata
Assignees
Labels
bug 🔥Something isn't workingSomething isn't working