Skip to content

Commit

Permalink
fix: url change should flush auth
Browse files Browse the repository at this point in the history
Signed-off-by: mathis-m <mathis.michel@outlook.de>
  • Loading branch information
mathis-m committed Mar 8, 2021
1 parent db830fb commit b0b63df
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/plugins/topbar/topbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -25,7 +26,14 @@ export default class Topbar extends React.Component {
this.setState({url: value})
}

flushAuthData() {
this.props.authActions.restoreAuthorization({
authorized: {}
})
}

loadSpec = (url) => {
this.flushAuthData()
this.props.specActions.updateUrl(url)
this.props.specActions.download(url)
}
Expand Down Expand Up @@ -107,7 +115,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
Expand Down

0 comments on commit b0b63df

Please sign in to comment.