[PR #6792] [MERGED] chore: delete session with hooks #15133

Closed
opened 2026-04-13 09:50:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6792
Author: @jonathansamines
Created: 12/16/2025
Status: Merged
Merged: 12/16/2025
Merged by: @himself65

Base: canaryHead: fix/delete-user-session-with-hooks


📝 Commits (1)

  • 1999bd2 chore(better-auth): delete session with hooks

📊 Changes

2 files changed (+19 additions, -11 deletions)

View changed files

📝 packages/better-auth/src/api/routes/sign-out.test.ts (+13 -2)
📝 packages/better-auth/src/db/internal-adapter.ts (+6 -9)

📄 Description

Summary by cubic

Sign-out now deletes the session using database hooks so after-delete handlers run. Added a test to confirm the hook is called.

  • Bug Fixes
    • Replaced direct session delete with deleteWithHooks in the internal adapter.
    • Added sign-out test that verifies the after session delete hook is invoked.

Written for commit 1999bd282d. 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/6792 **Author:** [@jonathansamines](https://github.com/jonathansamines) **Created:** 12/16/2025 **Status:** ✅ Merged **Merged:** 12/16/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/delete-user-session-with-hooks` --- ### 📝 Commits (1) - [`1999bd2`](https://github.com/better-auth/better-auth/commit/1999bd282dd5f49992da14462e9bcd0e2bb4d35c) chore(better-auth): delete session with hooks ### 📊 Changes **2 files changed** (+19 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/sign-out.test.ts` (+13 -2) 📝 `packages/better-auth/src/db/internal-adapter.ts` (+6 -9) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Sign-out now deletes the session using database hooks so after-delete handlers run. Added a test to confirm the hook is called. - **Bug Fixes** - Replaced direct session delete with deleteWithHooks in the internal adapter. - Added sign-out test that verifies the after session delete hook is invoked. <sup>Written for commit 1999bd282dd5f49992da14462e9bcd0e2bb4d35c. 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-04-13 09:50:54 -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#15133