Merge pull request #11312 from influxdata/fix/11302

fix(ui): remove returnTo on logout
pull/11413/head
Brandon Farmer 2019-01-22 12:53:15 -08:00 committed by GitHub
commit ba9e365aca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 12 deletions

View File

@ -22,14 +22,8 @@ export class Logout extends PureComponent<Props> {
private handleSignOut = async () => {
await logout()
const {query} = this.props.location
let returnTo = ''
if (query && query.returnTo) {
returnTo = `?returnTo=${query.returnTo}`
}
this.props.router.push(`/signin${returnTo}`)
this.props.router.push(`/signin`)
}
}

View File

@ -1,15 +1,14 @@
// Libraries
import React, {SFC} from 'react'
import {Link} from 'react-router'
import {withRouter, WithRouterProps} from 'react-router'
// Components
import {Button, ComponentSize} from 'src/clockface'
const LogoutButton: SFC<WithRouterProps> = props => (
<Link to={`/logout?returnTo=${props.location.pathname}`}>
const LogoutButton: SFC = () => (
<Link to="/logout">
<Button text="Logout" size={ComponentSize.ExtraSmall} />
</Link>
)
export default withRouter<{}>(LogoutButton)
export default LogoutButton

View File

@ -48,7 +48,7 @@ class SideNav extends PureComponent<Props> {
>
<NavMenu.SubItem
title="Logout"
link={`/logout?returnTo=${location.pathname}`}
link={`/logout`}
location={location.pathname}
highlightWhen={[]}
/>