🛡️ fix: OTP Verification For 2FA Disable Operation (#8975)

This commit is contained in:
Danny Avila 2025-08-10 15:05:16 -04:00 committed by GitHub
parent edf33bedcb
commit 7e4c8a5d0d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 58 additions and 30 deletions

View file

@ -134,12 +134,12 @@ export const useConfirmTwoFactorMutation = (): UseMutationResult<
export const useDisableTwoFactorMutation = (): UseMutationResult<
t.TDisable2FAResponse,
unknown,
void,
t.TDisable2FARequest | undefined,
unknown
> => {
const queryClient = useQueryClient();
return useMutation(() => dataService.disableTwoFactor(), {
onSuccess: (data) => {
return useMutation((payload?: t.TDisable2FARequest) => dataService.disableTwoFactor(payload), {
onSuccess: () => {
queryClient.setQueryData([QueryKeys.user, '2fa'], null);
},
});