Wire up logout link in Purgatory
parent
e90cc5be9c
commit
eed18c4fdd
|
@ -1,5 +1,5 @@
|
||||||
import React, {PropTypes} from 'react'
|
import React, {PropTypes} from 'react'
|
||||||
import {withRouter, Link} from 'react-router'
|
import {withRouter} from 'react-router'
|
||||||
import {connect} from 'react-redux'
|
import {connect} from 'react-redux'
|
||||||
|
|
||||||
import {MEMBER_ROLE} from 'src/auth/Authorized'
|
import {MEMBER_ROLE} from 'src/auth/Authorized'
|
||||||
|
@ -17,6 +17,7 @@ const Purgatory = ({
|
||||||
currentOrganization,
|
currentOrganization,
|
||||||
roles,
|
roles,
|
||||||
organizations,
|
organizations,
|
||||||
|
logoutLink,
|
||||||
}) => {
|
}) => {
|
||||||
const rolesAndOrgs = organizations.map(({id, name: orgName}) => ({
|
const rolesAndOrgs = organizations.map(({id, name: orgName}) => ({
|
||||||
id,
|
id,
|
||||||
|
@ -82,9 +83,9 @@ const Purgatory = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
: <p>You are a Lost Soul</p>}
|
: <p>You are a Lost Soul</p>}
|
||||||
<Link to={'/logout'} className="btn btn-sm btn-link auth--logout">
|
<a href={logoutLink} className="btn btn-sm btn-link auth--logout">
|
||||||
Logout
|
Logout
|
||||||
</Link>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="auth-credits">
|
<p className="auth-credits">
|
||||||
|
@ -121,11 +122,13 @@ Purgatory.propTypes = {
|
||||||
name: string,
|
name: string,
|
||||||
})
|
})
|
||||||
).isRequired,
|
).isRequired,
|
||||||
|
logoutLink: string.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
const mapStateToProps = ({
|
const mapStateToProps = ({
|
||||||
auth: {
|
auth: {
|
||||||
me: {name, provider, scheme, currentOrganization, roles, organizations},
|
me: {name, provider, scheme, currentOrganization, roles, organizations},
|
||||||
|
logoutLink,
|
||||||
},
|
},
|
||||||
}) => ({
|
}) => ({
|
||||||
name,
|
name,
|
||||||
|
@ -134,6 +137,7 @@ const mapStateToProps = ({
|
||||||
currentOrganization,
|
currentOrganization,
|
||||||
roles,
|
roles,
|
||||||
organizations,
|
organizations,
|
||||||
|
logoutLink,
|
||||||
})
|
})
|
||||||
|
|
||||||
export default connect(mapStateToProps)(withRouter(Purgatory))
|
export default connect(mapStateToProps)(withRouter(Purgatory))
|
||||||
|
|
Loading…
Reference in New Issue