MFA: Fix factors dialog closing when factors re-render. Removed debugging line setting the popup to Infinite
This commit is contained in:
@@ -168,7 +168,6 @@ function ConfirmUnenrollFactorModal(
|
|||||||
error: (error: string) => {
|
error: (error: string) => {
|
||||||
return error;
|
return error;
|
||||||
},
|
},
|
||||||
duration: Infinity
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[props, t, unEnroll],
|
[props, t, unEnroll],
|
||||||
@@ -245,9 +244,8 @@ function FactorsTable({
|
|||||||
|
|
||||||
<td>
|
<td>
|
||||||
<Badge
|
<Badge
|
||||||
variant={'info'}
|
|
||||||
className={'inline-flex capitalize'}
|
className={'inline-flex capitalize'}
|
||||||
color={factor.status === 'verified' ? 'success' : 'normal'}
|
variant={factor.status === 'verified' ? 'success' : 'outline'}
|
||||||
>
|
>
|
||||||
{factor.status}
|
{factor.status}
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import {
|
|||||||
DialogDescription,
|
DialogDescription,
|
||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
|
DialogTrigger,
|
||||||
} from '@kit/ui/dialog';
|
} from '@kit/ui/dialog';
|
||||||
import {
|
import {
|
||||||
Form,
|
Form,
|
||||||
@@ -56,36 +57,36 @@ export function MultiFactorAuthSetupDialog(props: { userId: string }) {
|
|||||||
}, [t]);
|
}, [t]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
||||||
<Button onClick={() => setIsOpen(true)}>
|
<DialogTrigger asChild>
|
||||||
<Trans i18nKey={'account:setupMfaButtonLabel'} />
|
<Button>
|
||||||
</Button>
|
<Trans i18nKey={'account:setupMfaButtonLabel'} />
|
||||||
|
</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
|
||||||
<Dialog open={isOpen} onOpenChange={setIsOpen}>
|
<DialogContent
|
||||||
<DialogContent
|
onInteractOutside={(e) => e.preventDefault()}
|
||||||
onInteractOutside={(e) => e.preventDefault()}
|
onEscapeKeyDown={(e) => e.preventDefault()}
|
||||||
onEscapeKeyDown={(e) => e.preventDefault()}
|
>
|
||||||
>
|
<DialogHeader>
|
||||||
<DialogHeader>
|
<DialogTitle>
|
||||||
<DialogTitle>
|
<Trans i18nKey={'account:setupMfaButtonLabel'} />
|
||||||
<Trans i18nKey={'account:setupMfaButtonLabel'} />
|
</DialogTitle>
|
||||||
</DialogTitle>
|
|
||||||
|
|
||||||
<DialogDescription>
|
<DialogDescription>
|
||||||
<Trans i18nKey={'account:multiFactorAuthDescription'} />
|
<Trans i18nKey={'account:multiFactorAuthDescription'} />
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<MultiFactorAuthSetupForm
|
<MultiFactorAuthSetupForm
|
||||||
userId={props.userId}
|
userId={props.userId}
|
||||||
onCancel={() => setIsOpen(false)}
|
onCancel={() => setIsOpen(false)}
|
||||||
onEnrolled={onEnrollSuccess}
|
onEnrolled={onEnrollSuccess}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user