diff --git a/demo/nextjs/app/(auth)/reset-password/page.tsx b/demo/nextjs/app/(auth)/reset-password/page.tsx index d950e427..1f8f757a 100644 --- a/demo/nextjs/app/(auth)/reset-password/page.tsx +++ b/demo/nextjs/app/(auth)/reset-password/page.tsx @@ -29,6 +29,7 @@ export default function ResetPassword() { setError(""); const res = await client.resetPassword({ newPassword: password, + token: new URLSearchParams(window.location.search).get("token")!, }); if (res.error) { toast.error(res.error.message); diff --git a/docs/content/docs/authentication/email-password.mdx b/docs/content/docs/authentication/email-password.mdx index 2c9f1522..e022e9b5 100644 --- a/docs/content/docs/authentication/email-password.mdx +++ b/docs/content/docs/authentication/email-password.mdx @@ -213,8 +213,13 @@ When a user clicks on the link in the email, they will be redirected to the rese - `newPassword`: The new password of the user. ```ts title="auth-client.ts" +const token = new URLSearchParams(window.location.search).get("token"); +if (!token) { + // Handle the error +} const { data, error } = await authClient.resetPassword({ newPassword: "password1234", + token, }); ```