fix(options/mfa): significant calls to OAuth status endpoint

This commit is contained in:
Elian Doran 2025-09-25 10:29:09 +03:00
parent db46ca0a76
commit a0a904766f
No known key found for this signature in database

View File

@ -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>
)
}
}