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 (
|
return (
|
||||||
<OptionsSection title={t("multi_factor_authentication.title")}>
|
<OptionsSection title={t("multi_factor_authentication.title")}>
|
||||||
<FormText><Trans i18nKey="multi_factor_authentication.description" /></FormText>
|
<FormText><Trans i18nKey="multi_factor_authentication.description" /></FormText>
|
||||||
@ -63,7 +63,7 @@ function MultiFactorMethod() {
|
|||||||
{ mfaMethod === "totp"
|
{ mfaMethod === "totp"
|
||||||
? t("multi_factor_authentication.totp_description")
|
? t("multi_factor_authentication.totp_description")
|
||||||
: <RawHtml html={t("multi_factor_authentication.oauth_description")} /> }
|
: <RawHtml html={t("multi_factor_authentication.oauth_description")} /> }
|
||||||
</FormText>
|
</FormText>
|
||||||
</OptionsSection>
|
</OptionsSection>
|
||||||
|
|
||||||
{ mfaMethod === "totp"
|
{ mfaMethod === "totp"
|
||||||
@ -159,7 +159,7 @@ function TotpSettings() {
|
|||||||
|
|
||||||
function TotpRecoveryKeys({ values, generateRecoveryKeys }: { values?: string[], generateRecoveryKeys: () => Promise<void> }) {
|
function TotpRecoveryKeys({ values, generateRecoveryKeys }: { values?: string[], generateRecoveryKeys: () => Promise<void> }) {
|
||||||
return (
|
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>
|
<FormText>{t("multi_factor_authentication.recovery_keys_description")}</FormText>
|
||||||
|
|
||||||
{values ? (
|
{values ? (
|
||||||
@ -182,7 +182,7 @@ function TotpRecoveryKeys({ values, generateRecoveryKeys }: { values?: string[],
|
|||||||
} else {
|
} else {
|
||||||
text = t("multi_factor_authentication.recovery_keys_unused", { index: key });
|
text = t("multi_factor_authentication.recovery_keys_unused", { index: key });
|
||||||
}
|
}
|
||||||
|
|
||||||
return <li>{text}</li>
|
return <li>{text}</li>
|
||||||
})}
|
})}
|
||||||
</ol>
|
</ol>
|
||||||
@ -207,7 +207,7 @@ function OAuthSettings() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
server.get<OAuthStatus>("oauth/status").then(setStatus);
|
server.get<OAuthStatus>("oauth/status").then(setStatus);
|
||||||
});
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<OptionsSection title={t("multi_factor_authentication.oauth_title")}>
|
<OptionsSection title={t("multi_factor_authentication.oauth_title")}>
|
||||||
@ -235,4 +235,4 @@ function OAuthSettings() {
|
|||||||
)}
|
)}
|
||||||
</OptionsSection>
|
</OptionsSection>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user