Skip to content

Commit f087fd0

Browse files
pltod2derberg
andauthored
fix: render specs that contain oauth2 password flow only (#1023)
Co-authored-by: Lukasz Gornicki <[email protected]>
1 parent 6936c78 commit f087fd0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

library/src/__tests__/docs/v3/streetlights-mqtt.json

+15
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@
6969
},
7070
{
7171
"$ref": "#/components/securitySchemes/openIdConnectWellKnown"
72+
},
73+
{
74+
"$ref": "#/components/securitySchemes/oauth2Password"
7275
}
7376
],
7477
"tags": [
@@ -348,6 +351,18 @@
348351
"openIdConnectWellKnown": {
349352
"type": "openIdConnect",
350353
"openIdConnectUrl": "https://authserver.example/.well-known"
354+
},
355+
"oauth2Password": {
356+
"type": "oauth2",
357+
"description": "Flows to support OAuth 2.0",
358+
"flows": {
359+
"password": {
360+
"tokenUrl": "https://authserver.example/token",
361+
"availableScopes": {
362+
"streetlights:on": "Ability to switch lights on"
363+
}
364+
}
365+
}
351366
}
352367
},
353368
"parameters": {

library/src/containers/Servers/Security.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const SecurityItem: React.FunctionComponent<SecurityItemProps> = ({
164164
unwrappedFlows.clientCredentials = flows.clientCredentials()!;
165165
}
166166
if (flows?.hasPassword()) {
167-
unwrappedFlows.password = flows.implicit()!;
167+
unwrappedFlows.password = flows.password()!;
168168
}
169169
const renderedFlows = Object.entries(unwrappedFlows).map(
170170
([flowName, flow]) => {

0 commit comments

Comments
 (0)