Skip to content

Commit

Permalink
Use enterprise_sso to conditionally render EnterpriseAccountsSection
Browse files Browse the repository at this point in the history
Previously, we were only relying on a check within `EnterpriseAccountsSection` to conditionally render it's content only if there's a least one active connection.

This is actually exactly what FAPI computes behind the scenes for `userSettings.enterprise_sso.enabled`. This commit utilizes `enterprise_sso` as another layer of assurance.
  • Loading branch information
LauraBeatris committed Nov 19, 2024
1 parent 9ade6d3 commit dc0f8ef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import { UserProfileSection } from './UserProfileSection';
import { Web3Section } from './Web3Section';

export const AccountPage = withCardStateProvider(() => {
const { attributes, social } = useEnvironment().userSettings;
const { attributes, social, enterprise_sso } = useEnvironment().userSettings;
const card = useCardState();
const { user } = useUser();

const showUsername = attributes.username.enabled;
const showEmail = attributes.email_address.enabled;
const showPhone = attributes.phone_number.enabled;
const showConnectedAccounts = social && Object.values(social).filter(p => p.enabled).length > 0;
const showEnterpriseAccounts = user && user.enterpriseAccounts.length > 0;
const showEnterpriseAccounts = user && enterprise_sso && user.enterpriseAccounts.length > 0;
const showWeb3 = attributes.web3_wallet.enabled;

const shouldAllowIdentificationCreation =
Expand Down

0 comments on commit dc0f8ef

Please sign in to comment.