Skip to content

Commit

Permalink
Handle case where auth options are combined (#1051)
Browse files Browse the repository at this point in the history
* handle case where options are combined

* remove console log
  • Loading branch information
sserrata authored Dec 16, 2024
1 parent 1f875bc commit fd92c40
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ function CodeSnippets({ postman, codeSamples }: Props) {
for (const key in obj) {
if (typeof obj[key] === "object" && obj[key] !== null) {
// use name as placeholder if exists
placeholder = clonedAuth?.options?.[key]?.[0]?.name;
const comboAuthId = Object.keys(obj).join(" and ");
const authOptions =
clonedAuth?.options?.[key] ?? clonedAuth?.options?.[comboAuthId];
placeholder = authOptions?.[0]?.name;
obj[key] = cleanCredentials(obj[key]);
} else {
obj[key] = `<${placeholder ?? key}>`;
Expand Down

0 comments on commit fd92c40

Please sign in to comment.