mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 22:46:24 +00:00
misc: addressed comments 1
This commit is contained in:
@@ -140,3 +140,17 @@ export const useDeleteUserTotpConfiguration = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export const useCreateNewTotpRecoveryCodes = () => {
|
||||
const queryClient = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async () => {
|
||||
await apiRequest.post("/api/v1/user/me/totp/recovery-codes");
|
||||
|
||||
return {};
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries(userKeys.totpConfiguration);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -480,7 +480,7 @@ export const useGetUserTotpConfiguration = () => {
|
||||
|
||||
return data;
|
||||
} catch (error) {
|
||||
if (error instanceof AxiosError && error.response?.data?.statusCode === 404) {
|
||||
if (error instanceof AxiosError && [404, 400].includes(error.response?.data?.statusCode)) {
|
||||
return {
|
||||
isVerified: false,
|
||||
recoveryCodes: []
|
||||
|
||||
Reference in New Issue
Block a user