fix(swagger-ui-react): re-enable SSR support (#9035)
SSR support was re-enabled by passing the oauth2RedirectUrl prop only when defined. Refs #8976
This commit is contained in:
@@ -37,7 +37,7 @@ export default class SwaggerUI extends React.Component {
|
||||
filter: this.props.filter,
|
||||
persistAuthorization: this.props.persistAuthorization,
|
||||
withCredentials: this.props.withCredentials,
|
||||
oauth2RedirectUrl: this.props.oauth2RedirectUrl
|
||||
...(typeof this.props.oauth2RedirectUrl === "string" ? { oauth2RedirectUrl: this.props.oauth2RedirectUrl} : {})
|
||||
})
|
||||
|
||||
this.system = ui
|
||||
@@ -166,7 +166,7 @@ SwaggerUI.defaultProps = {
|
||||
displayRequestDuration: false,
|
||||
withCredentials: undefined,
|
||||
persistAuthorization: false,
|
||||
oauth2RedirectUrl: `${window.location.protocol}//${window.location.host}${window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/"))}/oauth2-redirect.html`,
|
||||
oauth2RedirectUrl: undefined,
|
||||
}
|
||||
|
||||
SwaggerUI.presets = swaggerUIConstructor.presets
|
||||
|
||||
Reference in New Issue
Block a user