Merge "Fix whitelabel authz"
This commit is contained in:
@@ -65,8 +65,9 @@ const fetchUserACLFail = error => ({
|
||||
})
|
||||
|
||||
export const fetchUserACL = (tenant) => (dispatch) => {
|
||||
dispatch(fetchUserACLRequest(tenant))
|
||||
let apiPrefix = tenant? 'tenant/' + tenant + '/' : ''
|
||||
dispatch(fetchUserACLRequest(tenant? tenant.name : null))
|
||||
// tenant.name will be null if we're at the root
|
||||
const apiPrefix = tenant && tenant.name ? tenant.apiPrefix : ''
|
||||
return API.fetchUserAuthorizations(apiPrefix)
|
||||
.then(response => dispatch(fetchUserACLSuccess(response.data)))
|
||||
.catch(error => {
|
||||
|
||||
@@ -109,8 +109,8 @@ class AuthContainer extends React.Component {
|
||||
this.props.userManager.events.addUserLoaded(this.onUserLoaded)
|
||||
|
||||
if (user.data) {
|
||||
console.log('Refreshing ACL', user.tenant, tenant.name)
|
||||
this.props.dispatch(fetchUserACL(tenant? tenant.name : null))
|
||||
console.log('Refreshing ACL', user.tenant, tenant)
|
||||
this.props.dispatch(fetchUserACL(tenant))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,8 +124,8 @@ class AuthContainer extends React.Component {
|
||||
|
||||
// Make sure the token is current and the tenant is up to date.
|
||||
if (user.data && user.tenant !== tenant.name) {
|
||||
console.log('Refreshing ACL', user.tenant, tenant.name)
|
||||
this.props.dispatch(fetchUserACL(tenant? tenant.name : null))
|
||||
console.log('Refreshing ACL', user.tenant, tenant)
|
||||
this.props.dispatch(fetchUserACL(tenant))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user