Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] 2FA by Email setting showing for the user even when disabled by the admin #18473

Merged
merged 1 commit into from
Aug 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions client/account/security/AccountSecurityPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const AccountSecurityPage = () => {
const t = useTranslation();

const twoFactorEnabled = useSetting('Accounts_TwoFactorAuthentication_Enabled');
const twoFactorByEmailEnabled = useSetting('Accounts_TwoFactorAuthentication_By_Email_Enabled');
const e2eEnabled = useSetting('E2E_Enable');

if (!twoFactorEnabled && !e2eEnabled) {
Expand All @@ -24,9 +25,9 @@ const AccountSecurityPage = () => {
<Page.ScrollableContentWithShadow>
<Box maxWidth='x600' w='full' alignSelf='center'>
<Accordion>
{twoFactorEnabled && <Accordion.Item title={t('Two Factor Authentication')} defaultExpanded>
<TwoFactorTOTP />
<TwoFactorEmail />
{(twoFactorEnabled || twoFactorByEmailEnabled) && <Accordion.Item title={t('Two Factor Authentication')} defaultExpanded>
{twoFactorEnabled && <TwoFactorTOTP />}
{twoFactorByEmailEnabled && <TwoFactorEmail />}
</Accordion.Item>}
{e2eEnabled && <Accordion.Item title={t('E2E Encryption')} defaultExpanded={!twoFactorEnabled}>
<EndToEnd />
Expand Down