Refine OTP and passkey sections in account settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Developing-Gamer 2026-05-27 13:35:41 -07:00
parent 974790e438
commit 48c5f353ff
2 changed files with 6 additions and 3 deletions

View File

@ -44,8 +44,11 @@ function OtpSectionInner({ user }: { user: any }) {
const hasValidEmail = contactChannels.filter((x: any) => (x.type as string) === 'email' && x.isVerified && x.usedForAuth).length > 0;
const handleDisableOTP = async () => {
await user.update({ otpAuthEnabled: false });
setDisabling(false);
try {
await user.update({ otpAuthEnabled: false });
} finally {
setDisabling(false);
}
};
return (

View File

@ -11,6 +11,7 @@ export function PasskeySection(props?: {
const isInMockMode = !!props?.mockMode;
const user = useUser({ or: isInMockMode ? 'return-null' : "redirect" });
const stackApp = useStackApp();
const project = stackApp.useProject();
// In mock mode, show a placeholder message
if (isInMockMode && !user) {
@ -28,7 +29,6 @@ export function PasskeySection(props?: {
return null;
}
const project = stackApp.useProject();
if (!project.config.passkeyEnabled) {
return null;
}