docs: add revokeSessionsOnPasswordReset to password reset section (#8551)

Co-authored-by: Maxwell <145994855+ping-maxwell@users.noreply.github.com>
This commit is contained in:
Jan Jürgen Luzgin
2026-04-25 02:19:51 +02:00
committed by GitHub
parent c1336c563d
commit 89af592e93

View File

@@ -374,6 +374,22 @@ const { data, error } = await authClient.resetPassword({
```
</APIMethod>
#### Revoking Sessions on Password Reset
By default, other active sessions are **not** revoked when a user resets their password. To revoke all user sessions on password reset, set `revokeSessionsOnPasswordReset` to `true`:
```ts title="auth.ts"
export const auth = betterAuth({
emailAndPassword: {
enabled: true,
revokeSessionsOnPasswordReset: true, // [!code highlight]
sendResetPassword: async ({ user, url, token }, request) => {
// your email sending logic
},
},
});
```
### Update password
A user's password isn't stored in the user table. Instead, it's stored in the account table. To change the password of a user, you can use one of the following approaches: