Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

Commit

Permalink
[MM-14746] Show Remove MFA Item in System Console only for Users that…
Browse files Browse the repository at this point in the history
… enabled MFA (#2602)

* Ensure show prop is always of type bool to avoid unintentional items to be shown

* Use explicit coercion
  • Loading branch information
DSchalla committed Apr 4, 2019
1 parent 4018573 commit cbd6c97
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ export default class SystemUsersDropdown extends React.Component {
let showMakeNotActive = !Utils.isSystemAdmin(user.roles);
let showManageTeams = true;
let showRevokeSessions = true;
const showMfaReset = this.props.mfaEnabled && user.mfa_active && !user.is_bot;
const showMfaReset = this.props.mfaEnabled && Boolean(user.mfa_active) && !user.is_bot;

if (user.delete_at > 0) {
currentRoles = (
Expand Down Expand Up @@ -407,7 +407,7 @@ export default class SystemUsersDropdown extends React.Component {
text={Utils.localizeMessage('admin.user_item.resetMfa', 'Remove MFA')}
/>
<MenuItemAction
show={user.auth_service && this.props.experimentalEnableAuthenticationTransfer && !user.is_bot}
show={Boolean(user.auth_service) && this.props.experimentalEnableAuthenticationTransfer && !user.is_bot}
onClick={this.handleResetPassword}
text={Utils.localizeMessage('admin.user_item.switchToEmail', 'Switch to Email/Password')}
/>
Expand Down

0 comments on commit cbd6c97

Please sign in to comment.