mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-13 21:01:21 +08:00
Refine OTP and passkey sections in account settings.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
974790e438
commit
48c5f353ff
@ -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 (
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user