Skip to content

Commit

Permalink
feat(swagger-ui-react): Add oauth2RedirectUrl prop (#8028)
Browse files Browse the repository at this point in the history
  • Loading branch information
lars1974 committed May 25, 2022
1 parent c70b9d7 commit 03a981a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions flavors/swagger-ui-react/README.md
Expand Up @@ -164,6 +164,14 @@ If set to `true`, enables passing credentials, [as defined in the Fetch standard

⚠️ This prop is currently only applied once, on mount. Changes to this prop's value will not be propagated to the underlying Swagger UI instance. A future version of this module will remove this limitation, and the change will not be considered a breaking change.

#### `oauth2RedirectUrl`: PropTypes.string

Redirect url given as parameter to the oauth2 provider. Default the url refers to oauth2-redirect.html at the same path as the Swagger UI is available.

⚠️ This prop is currently only applied once, on mount. Changes to this prop's value will not be propagated to the underlying Swagger UI instance. A future version of this module will remove this limitation, and the change will not be considered a breaking change.



## Limitations

* Not all configuration bindings are available.
Expand Down
2 changes: 2 additions & 0 deletions flavors/swagger-ui-react/index.jsx
Expand Up @@ -36,6 +36,7 @@ export default class SwaggerUI extends React.Component {
filter: ["boolean", "string"].includes(typeof this.props.filter) ? this.props.filter : false,
persistAuthorization: this.props.persistAuthorization,
withCredentials: this.props.withCredentials,
oauth2RedirectUrl: this.props.oauth2RedirectUrl
})

this.system = ui
Expand Down Expand Up @@ -131,6 +132,7 @@ SwaggerUI.propTypes = {
displayRequestDuration: PropTypes.bool,
persistAuthorization: PropTypes.bool,
withCredentials: PropTypes.bool,
oauth2RedirectUrl: PropTypes.string,
}

SwaggerUI.defaultProps = {
Expand Down

0 comments on commit 03a981a

Please sign in to comment.