[PR #6246] feat(auth): add auto sign-in feature after password reset and update related tests #6545

Open
opened 2026-03-13 13:02:47 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6246
Author: @rovertrack
Created: 11/23/2025
Status: 🔄 Open

Base: canaryHead: feat/reset-password


📝 Commits (3)

  • 4fb7003 feat(auth): add auto sign-in feature after password reset and update related tests
  • e042b17 Merge branch 'canary' into feat/reset-password
  • e8b25b0 Update packages/better-auth/src/api/routes/reset-password.ts

📊 Changes

3 files changed (+90 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/api/routes/reset-password.test.ts (+50 -0)
📝 packages/better-auth/src/api/routes/reset-password.ts (+33 -0)
📝 packages/core/src/types/init-options.ts (+7 -0)

📄 Description

solves #6130

If this is good i will update the docs for its usage shortly.


Summary by cubic

Adds optional auto sign-in right after a successful password reset. When enabled, the server creates or reuses a session and sets the session cookie.

  • New Features

    • emailAndPassword.autoSignInOnResetPassword option (default false).
    • On reset success, reuse current session or create a new one, then set the session cookie.
    • Added tests covering the auto sign-in flow.
  • Migration

    • To enable, set emailAndPassword.autoSignInOnResetPassword: true in BetterAuth options.

Written for commit e8b25b044c. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6246 **Author:** [@rovertrack](https://github.com/rovertrack) **Created:** 11/23/2025 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `feat/reset-password` --- ### 📝 Commits (3) - [`4fb7003`](https://github.com/better-auth/better-auth/commit/4fb7003b85f6916ece22d7c89cd44b772bc7642b) feat(auth): add auto sign-in feature after password reset and update related tests - [`e042b17`](https://github.com/better-auth/better-auth/commit/e042b17c3930559786335c3b1cb9ef6b5b5bbf63) Merge branch 'canary' into feat/reset-password - [`e8b25b0`](https://github.com/better-auth/better-auth/commit/e8b25b044c35e6be8557cbf41fea7ef9bbc4ac8b) Update packages/better-auth/src/api/routes/reset-password.ts ### 📊 Changes **3 files changed** (+90 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/reset-password.test.ts` (+50 -0) 📝 `packages/better-auth/src/api/routes/reset-password.ts` (+33 -0) 📝 `packages/core/src/types/init-options.ts` (+7 -0) </details> ### 📄 Description solves **#6130** **If this is good i will update the docs for its usage shortly.** <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds optional auto sign-in right after a successful password reset. When enabled, the server creates or reuses a session and sets the session cookie. - **New Features** - emailAndPassword.autoSignInOnResetPassword option (default false). - On reset success, reuse current session or create a new one, then set the session cookie. - Added tests covering the auto sign-in flow. - **Migration** - To enable, set emailAndPassword.autoSignInOnResetPassword: true in BetterAuth options. <sup>Written for commit e8b25b044c35e6be8557cbf41fea7ef9bbc4ac8b. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:02:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#6545