Skip to content

Commit

Permalink
fix: pass token when resetting password
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Jan 17, 2025
1 parent b21d926 commit eb47ec2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/server/client/pages/(login)/reset-password.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit eb47ec2

Please sign in to comment.