[PR #1995] [MERGED] fix: only delete verification token after succesful db query #4113

Closed
opened 2026-03-13 11:33:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1995
Author: @moshetanzer
Created: 3/25/2025
Status: Merged
Merged: 3/25/2025
Merged by: @Bekacru

Base: mainHead: fix/delete-reset-token-later


📝 Commits (1)

  • 515352b fix: only delete verification token after succesful db query

📊 Changes

1 file changed (+6 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/api/routes/forget-password.ts (+6 -1)

📄 Description

Hey,

This PR will help for dbhooks, since right now if a dbhook returns an error (for example a validation error), the verification token will be already removed.

Thanks for great lib 😄


🔄 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/1995 **Author:** [@moshetanzer](https://github.com/moshetanzer) **Created:** 3/25/2025 **Status:** ✅ Merged **Merged:** 3/25/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `fix/delete-reset-token-later` --- ### 📝 Commits (1) - [`515352b`](https://github.com/better-auth/better-auth/commit/515352bcdc17a9d8603721902629d09b80f4af19) fix: only delete verification token after succesful db query ### 📊 Changes **1 file changed** (+6 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/forget-password.ts` (+6 -1) </details> ### 📄 Description Hey, This PR will help for dbhooks, since right now if a dbhook returns an error (for example a validation error), the verification token will be already removed. Thanks for great lib 😄 --- <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 11:33:04 -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#4113