[PR #8046] [MERGED] fix(phone-number): call callback on password reset #7709

Closed
opened 2026-03-13 13:46:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8046
Author: @jslno
Created: 2/18/2026
Status: Merged
Merged: 2/19/2026
Merged by: @Bekacru

Base: canaryHead: 02-18-2026/phone-number-password-reset-cb


📝 Commits (2)

  • 60ae7e8 fix(phone-number): call callback on password reset
  • 8a5b47c chore: fix linting

📊 Changes

2 files changed (+85 additions, -2 deletions)

View changed files

📝 packages/better-auth/src/plugins/phone-number/phone-number.test.ts (+76 -0)
📝 packages/better-auth/src/plugins/phone-number/routes.ts (+9 -2)

📄 Description

closes #8042


Summary by cubic

Calls the onPasswordReset callback when a user resets their password via phone number, making the phone reset flow consistent and enabling downstream hooks.

  • Bug Fixes
    • Invoke emailAndPassword.onPasswordReset after successful phone-number password reset.
    • Use UserWithPhoneNumber for adapter lookup to ensure correct user shape.
    • Keep session revocation behavior intact (runs after the callback).
    • Add tests to verify the callback is called with the user’s phone number.

Written for commit 8a5b47ce4c. Summary will update 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/8046 **Author:** [@jslno](https://github.com/jslno) **Created:** 2/18/2026 **Status:** ✅ Merged **Merged:** 2/19/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `02-18-2026/phone-number-password-reset-cb` --- ### 📝 Commits (2) - [`60ae7e8`](https://github.com/better-auth/better-auth/commit/60ae7e8e9fb62b7ca6968722d65261c0a0adb8a1) fix(phone-number): call callback on password reset - [`8a5b47c`](https://github.com/better-auth/better-auth/commit/8a5b47ce4cfdc0e1e6a7f3c057b617754f4bf33e) chore: fix linting ### 📊 Changes **2 files changed** (+85 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/phone-number/phone-number.test.ts` (+76 -0) 📝 `packages/better-auth/src/plugins/phone-number/routes.ts` (+9 -2) </details> ### 📄 Description closes #8042 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Calls the onPasswordReset callback when a user resets their password via phone number, making the phone reset flow consistent and enabling downstream hooks. - **Bug Fixes** - Invoke emailAndPassword.onPasswordReset after successful phone-number password reset. - Use UserWithPhoneNumber for adapter lookup to ensure correct user shape. - Keep session revocation behavior intact (runs after the callback). - Add tests to verify the callback is called with the user’s phone number. <sup>Written for commit 8a5b47ce4cfdc0e1e6a7f3c057b617754f4bf33e. Summary will update 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:46:38 -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#7709