B: Do not revalidate auth on password reset
This commit is contained in:
parent
c666f2b41a
commit
a9d8193e2a
|
@ -1,18 +1,15 @@
|
||||||
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useMutation } from '@tanstack/react-query';
|
||||||
|
|
||||||
import { authApi, IPasswordTokenDTO, IResetPasswordDTO } from './api';
|
import { authApi, IPasswordTokenDTO, IResetPasswordDTO } from './api';
|
||||||
|
|
||||||
export const useResetPassword = () => {
|
export const useResetPassword = () => {
|
||||||
const client = useQueryClient();
|
|
||||||
const validateMutation = useMutation({
|
const validateMutation = useMutation({
|
||||||
mutationKey: ['reset-password'],
|
mutationKey: ['reset-password'],
|
||||||
mutationFn: authApi.validatePasswordToken,
|
mutationFn: authApi.validatePasswordToken
|
||||||
onSuccess: () => client.invalidateQueries({ queryKey: [authApi.baseKey] })
|
|
||||||
});
|
});
|
||||||
const resetMutation = useMutation({
|
const resetMutation = useMutation({
|
||||||
mutationKey: ['reset-password'],
|
mutationKey: ['reset-password'],
|
||||||
mutationFn: authApi.resetPassword,
|
mutationFn: authApi.resetPassword
|
||||||
onSuccess: () => client.invalidateQueries({ queryKey: [authApi.baseKey] })
|
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
validateToken: (
|
validateToken: (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user