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