docs: pass token in reset-password (#1237)

This commit is contained in:
Stephen Zhou
2025-01-20 16:00:19 +08:00
committed by GitHub
parent f61d862682
commit 32db33a260
2 changed files with 6 additions and 0 deletions

View File

@@ -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);

View File

@@ -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,
});
```