diff --git a/src/components/pages/settings/parts/SettingsMfa/TwoFAButton.tsx b/src/components/pages/settings/parts/SettingsMfa/TwoFAButton.tsx index fb551606..f06ee622 100755 --- a/src/components/pages/settings/parts/SettingsMfa/TwoFAButton.tsx +++ b/src/components/pages/settings/parts/SettingsMfa/TwoFAButton.tsx @@ -27,9 +27,9 @@ export default function TwoFAButton() { const [totpOpen, setTotpOpen] = useState(false); const { - data: twoData, - error: twoError, - isLoading: twoLoading, + data: mfaData, + error: mfaError, + isLoading: mfaLoading, } = useSWR>( totpOpen && !user?.totpSecret ? '/api/user/mfa/totp' : null, null, @@ -51,7 +51,7 @@ export default function TwoFAButton() { 'POST', { code: pin, - secret: twoData!.secret, + secret: mfaData!.secret, }, ); @@ -156,25 +156,20 @@ export default function TwoFAButton() { - {twoLoading && !twoError ? ( + {mfaLoading && !mfaError ? ( ) : (
- {'qr + {'qr
)}
If you can't scan the QR code, you can manually enter the following code into your - authenticator app: {twoData?.secret ?? ''} + authenticator app: {mfaData?.secret ?? ''}