mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 08:58:58 +01:00
fix(options/mfa): significant calls to OAuth status endpoint
This commit is contained in:
parent
db46ca0a76
commit
a0a904766f
@ -30,7 +30,7 @@ export default function MultiFactorAuthenticationSettings() {
|
||||
)
|
||||
}
|
||||
|
||||
function EnableMultiFactor({ mfaEnabled, setMfaEnabled }: { mfaEnabled: boolean, setMfaEnabled: (newValue: boolean) => Promise<void>}) {
|
||||
function EnableMultiFactor({ mfaEnabled, setMfaEnabled }: { mfaEnabled: boolean, setMfaEnabled: (newValue: boolean) => Promise<void>}) {
|
||||
return (
|
||||
<OptionsSection title={t("multi_factor_authentication.title")}>
|
||||
<FormText><Trans i18nKey="multi_factor_authentication.description" /></FormText>
|
||||
@ -63,7 +63,7 @@ function MultiFactorMethod() {
|
||||
{ mfaMethod === "totp"
|
||||
? t("multi_factor_authentication.totp_description")
|
||||
: <RawHtml html={t("multi_factor_authentication.oauth_description")} /> }
|
||||
</FormText>
|
||||
</FormText>
|
||||
</OptionsSection>
|
||||
|
||||
{ mfaMethod === "totp"
|
||||
@ -159,7 +159,7 @@ function TotpSettings() {
|
||||
|
||||
function TotpRecoveryKeys({ values, generateRecoveryKeys }: { values?: string[], generateRecoveryKeys: () => Promise<void> }) {
|
||||
return (
|
||||
<OptionsSection title={t("multi_factor_authentication.recovery_keys_title")}>
|
||||
<OptionsSection title={t("multi_factor_authentication.recovery_keys_title")}>
|
||||
<FormText>{t("multi_factor_authentication.recovery_keys_description")}</FormText>
|
||||
|
||||
{values ? (
|
||||
@ -182,7 +182,7 @@ function TotpRecoveryKeys({ values, generateRecoveryKeys }: { values?: string[],
|
||||
} else {
|
||||
text = t("multi_factor_authentication.recovery_keys_unused", { index: key });
|
||||
}
|
||||
|
||||
|
||||
return <li>{text}</li>
|
||||
})}
|
||||
</ol>
|
||||
@ -207,7 +207,7 @@ function OAuthSettings() {
|
||||
|
||||
useEffect(() => {
|
||||
server.get<OAuthStatus>("oauth/status").then(setStatus);
|
||||
});
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<OptionsSection title={t("multi_factor_authentication.oauth_title")}>
|
||||
@ -235,4 +235,4 @@ function OAuthSettings() {
|
||||
)}
|
||||
</OptionsSection>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user