mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 07:38:53 +02:00
chore(react/settings): add back some checks for MFA
This commit is contained in:
parent
44825af0c0
commit
018a6cb84a
@ -14,15 +14,20 @@ import Button from "../../react/Button"
|
|||||||
import dialog from "../../../services/dialog"
|
import dialog from "../../../services/dialog"
|
||||||
import toast from "../../../services/toast"
|
import toast from "../../../services/toast"
|
||||||
import RawHtml from "../../react/RawHtml"
|
import RawHtml from "../../react/RawHtml"
|
||||||
|
import { isElectron } from "../../../services/utils"
|
||||||
|
|
||||||
export default function MultiFactorAuthenticationSettings() {
|
export default function MultiFactorAuthenticationSettings() {
|
||||||
const [ mfaEnabled, setMfaEnabled ] = useTriliumOptionBool("mfaEnabled");
|
const [ mfaEnabled, setMfaEnabled ] = useTriliumOptionBool("mfaEnabled");
|
||||||
|
|
||||||
return (
|
return (!isElectron()
|
||||||
<>
|
? (
|
||||||
<EnableMultiFactor mfaEnabled={mfaEnabled} setMfaEnabled={setMfaEnabled} />
|
<>
|
||||||
<MultiFactorMethod />
|
<EnableMultiFactor mfaEnabled={mfaEnabled} setMfaEnabled={setMfaEnabled} />
|
||||||
</>
|
{ mfaEnabled && <MultiFactorMethod /> }
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<FormText>{t("multi_factor_authentication.electron_disabled")}</FormText>
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,14 +75,6 @@ function MultiFactorMethod() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function TotpSettings() {
|
function TotpSettings() {
|
||||||
return (
|
|
||||||
<div class="totp-options">
|
|
||||||
<TotpGenerateSecret />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function TotpGenerateSecret() {
|
|
||||||
const [ totpStatus, setTotpStatus ] = useState<TOTPStatus>();
|
const [ totpStatus, setTotpStatus ] = useState<TOTPStatus>();
|
||||||
const [ recoveryKeys, setRecoveryKeys ] = useState<string[]>();
|
const [ recoveryKeys, setRecoveryKeys ] = useState<string[]>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user