fix: pass token when resetting password
This commit is contained in:
parent
b21d92629f
commit
eb47ec2cca
|
|
@ -50,7 +50,12 @@ export function Component() {
|
|||
const navigate = useNavigate()
|
||||
const updateMutation = useMutation({
|
||||
mutationFn: async (values: z.infer<typeof initPasswordFormSchema>) => {
|
||||
const res = await resetPassword({ newPassword: values.newPassword })
|
||||
const token = new URLSearchParams(window.location.search).get("token")
|
||||
if (!token) {
|
||||
throw new Error("Token not found")
|
||||
}
|
||||
|
||||
const res = await resetPassword({ newPassword: values.newPassword, token })
|
||||
const error = res.error?.message
|
||||
if (error) {
|
||||
throw new Error(error)
|
||||
|
|
|
|||
Loading…
Reference in New Issue