> This page location: Auth > Guides > Password reset
> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

> Summary: Managed Better Auth password reset sends a verification link to the user's email and requires email authentication to be enabled in project Settings. The pre-built `<ForgotPasswordForm>` and `<ResetPasswordForm>` components handle the full forgot-password flow; reset links expire after 1 hour, and the SDK `resetPasswordForEmail` method is not yet supported. An optional per-branch setting, `revoke_sessions_on_password_reset`, signs the user out of every existing session after a successful reset.

# Password reset

Allow users to reset forgotten passwords

Last updated: 2026-11-20

Password reset allows users to securely reset forgotten passwords. Managed Better Auth supports password reset via verification links sent to the user's email address.

## Enable password reset

In your project's **Settings** → **Better Auth** page, ensure **Sign-in with Email** is enabled. Password reset is automatically available when email authentication is enabled.

## Using UI components

With [Better Auth UI](https://neon.com/docs/auth/reference/ui-components), password reset is built in. `npx shadcn@latest add @better-auth-ui/auth` adds the `forgot-password`, `reset-link-sent`, and `reset-password` views, and the sign-in view links to **Forgot password?**.

### 1. Route the auth views

Render `<Auth>` for every auth path, as in the [Next.js App Router example](https://neon.com/docs/auth/reference/ui-components#nextjs-app-router):

```tsx filename="app/auth/[path]/page.tsx"
import { viewPaths } from '@better-auth-ui/core';
import { Auth } from '@/components/auth/auth';

export const dynamicParams = false;

export function generateStaticParams() {
  return Object.values(viewPaths.auth).map((path) => ({ path }));
}

export default async function AuthPage({ params }: { params: Promise<{ path: string }> }) {
  const { path } = await params;
  return <Auth path={path} />;
}
```

`/auth/forgot-password` asks for the email and sends the reset link. The link opens `/auth/reset-password`, where the user sets a new password.

### 2. Render a single view

To place a view somewhere else, pass the view name instead of a path:

```tsx filename="src/ForgotPasswordPage.tsx"
import { Auth } from '@/components/auth/auth';

export function ForgotPasswordPage() {
  return <Auth view="forgotPassword" />;
}
```

The copied components (`components/auth/forgot-password.tsx` and `components/auth/reset-password.tsx`) are yours to edit.

**Note:** SDK methods for password reset (`resetPasswordForEmail`) are not fully supported yet. Use the UI components for password reset functionality.

## Password reset flow

The complete password reset flow works as follows:

1. **User requests reset**: User enters their email and clicks "Send reset link"
2. **Email sent**: User receives a verification link with a reset token
3. **User clicks link**: User is redirected to your app's reset password page
4. **User enters new password**: User submits the new password
5. **Password reset**: Password is updated and user is signed in (if auto-sign-in is enabled)

## Reset link expiration

Password reset links expire after **1 hour**. If a link expires, users need to request a new one.

## Sign users out after a reset

By default, resetting a password doesn't end the user's existing sessions. Turn on **Revoke sessions on password reset** to sign the user out of every existing session when they reset their password. This applies to resets through a reset link (`/reset-password`) and through [Email OTP](https://neon.com/docs/auth/guides/plugins/email-otp#reset-password-with-otp) (`/email-otp/reset-password`), whether your app calls those endpoints directly or through a proxy.

**Console**

In your project's **Settings** → **Better Auth** page, turn on **Revoke sessions on password reset**. The switch appears under **Sign-in with Email** while that switch is on.

**CLI**

Turn on the setting using [`neon neon-auth config email-password update`](https://neon.com/docs/cli/neon-auth#config-email-password-update):

```bash
neon neon-auth config email-password update --revoke-sessions-on-password-reset
```

`neon neon-auth config email-password get` shows the current value.

**API**

Use the [Update email and password configuration](https://neon.com/docs/reference/api/auth/update-neon-auth-email-and-password-config) endpoint. Replace `{project_id}` and `{branch_id}` with your project and branch IDs:

```bash
curl -X PATCH 'https://console.neon.tech/api/v2/projects/{project_id}/branches/{branch_id}/auth/email_and_password' \
  -H "Authorization: Bearer $NEON_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"revoke_sessions_on_password_reset": true}'
```

A `GET` request to the same endpoint returns the current value.

Consuming the reset link or code, deleting the user's sessions, and saving the new password happen in a single database transaction. If any step fails, the reset returns an error, so a successful reset always revokes every session that existed when it ran. A revoked session is rejected on its next request. Managed Better Auth doesn't use a session cookie cache or secondary session storage, so every session check reads the database.

The setting is off by default so existing apps don't sign users out unexpectedly. It's configured per branch. A new branch copies its parent's auth configuration when you create it, so turning the setting on for a parent doesn't change branches that already exist.

To sign out other devices when a signed-in user changes their password, pass `revokeOtherSessions: true` to `changePassword()`. See [Revoke other sessions](https://neon.com/docs/auth/guides/user-management#revoke-other-sessions).

## Next steps

- [Add email verification](https://neon.com/docs/auth/guides/email-verification) to ensure users own their email addresses
- [Customize the application name](https://neon.com/docs/auth/production-checklist#application-name) shown in password reset emails
- [Learn how to branch your auth](https://neon.com/docs/auth/branching-authentication) to use database branches with isolated auth environments

---

## Related docs (Guides)

- [Email verification](https://neon.com/docs/auth/guides/email-verification)
- [Set up OAuth](https://neon.com/docs/auth/guides/setup-oauth)
- [User management](https://neon.com/docs/auth/guides/user-management)
- [Configure domains](https://neon.com/docs/auth/guides/configure-domains)
- [Webhooks](https://neon.com/docs/auth/guides/webhooks)
- [Customize emails](https://neon.com/docs/auth/guides/customize-emails)
- [Production checklist](https://neon.com/docs/auth/production-checklist)
- [Troubleshooting](https://neon.com/docs/auth/troubleshooting)
- [Manage Auth via the API](https://neon.com/docs/auth/guides/manage-auth-api)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/docs/auth/guides/password-reset"}` to https://feedback.neon.tech/ (no auth required).
