diff --git a/docs/content/docs/authentication/email-password.mdx b/docs/content/docs/authentication/email-password.mdx index e6a9e1365c..9db94d67f2 100644 --- a/docs/content/docs/authentication/email-password.mdx +++ b/docs/content/docs/authentication/email-password.mdx @@ -374,6 +374,22 @@ const { data, error } = await authClient.resetPassword({ ``` +#### 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: