fix(auth): url change should flush auth (#7046)
This commit is contained in:
@@ -8,7 +8,8 @@ import {parseSearch, serializeSearch} from "../../core/utils"
|
||||
export default class Topbar extends React.Component {
|
||||
|
||||
static propTypes = {
|
||||
layoutActions: PropTypes.object.isRequired
|
||||
layoutActions: PropTypes.object.isRequired,
|
||||
authActions: PropTypes.object.isRequired
|
||||
}
|
||||
|
||||
constructor(props, context) {
|
||||
@@ -25,7 +26,19 @@ export default class Topbar extends React.Component {
|
||||
this.setState({url: value})
|
||||
}
|
||||
|
||||
flushAuthData() {
|
||||
const { persistAuthorization } = this.props.getConfigs()
|
||||
if (persistAuthorization)
|
||||
{
|
||||
return
|
||||
}
|
||||
this.props.authActions.restoreAuthorization({
|
||||
authorized: {}
|
||||
})
|
||||
}
|
||||
|
||||
loadSpec = (url) => {
|
||||
this.flushAuthData()
|
||||
this.props.specActions.updateUrl(url)
|
||||
this.props.specActions.download(url)
|
||||
}
|
||||
@@ -107,7 +120,7 @@ export default class Topbar extends React.Component {
|
||||
const classNames = ["download-url-input"]
|
||||
if (isFailed) classNames.push("failed")
|
||||
if (isLoading) classNames.push("loading")
|
||||
|
||||
|
||||
const { urls } = getConfigs()
|
||||
let control = []
|
||||
let formOnSubmit = null
|
||||
|
||||
Reference in New Issue
Block a user