Skip to content

Commit

Permalink
Fix confidential OAuth flow (#111802) (#111809)
Browse files Browse the repository at this point in the history
Previously we were accepting "string | undefined" as `state` parameter.
But if the `state` was not present in the URL, we received null.
That was breaking the confidential flow in cases where `state` was not provided.
This commit changes the type of parameter to "string | null" and fixes the flow in such cases.

Co-authored-by: Vadim Yakhin <[email protected]>
  • Loading branch information
kibanamachine and yakhinvadim authored Sep 10, 2021
1 parent 07ef0b8 commit 9b6629a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function registerOAuthAuthorizeRoute({
response_mode: schema.maybe(schema.string()),
redirect_uri: schema.maybe(schema.string()),
scope: schema.maybe(schema.string()),
state: schema.maybe(schema.string()),
state: schema.nullable(schema.string()),
}),
},
},
Expand All @@ -49,7 +49,7 @@ export function registerOAuthAuthorizeAcceptRoute({
response_type: schema.string(),
redirect_uri: schema.maybe(schema.string()),
scope: schema.maybe(schema.string()),
state: schema.maybe(schema.string()),
state: schema.nullable(schema.string()),
}),
},
},
Expand All @@ -72,7 +72,7 @@ export function registerOAuthAuthorizeDenyRoute({
response_type: schema.string(),
redirect_uri: schema.maybe(schema.string()),
scope: schema.maybe(schema.string()),
state: schema.maybe(schema.string()),
state: schema.nullable(schema.string()),
}),
},
},
Expand Down

0 comments on commit 9b6629a

Please sign in to comment.