[PR #3820] [MERGED] feat: remove revoked session from active list #5024

Closed
opened 2026-03-13 12:08:17 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/3820
Author: @himself65
Created: 8/6/2025
Status: Merged
Merged: 8/6/2025
Merged by: @Bekacru

Base: canaryHead: himself65/2025/08/05/session


📝 Commits (8)

  • 9f0d41a feat: remove revoked session from active list
  • 1721c3e feat: remove revoked session from active list
  • df5d411 should throw error?
  • a22572e feat: bypass logger
  • 27cb738 test: update
  • d05c55a Merge branch 'canary' into himself65/2025/08/05/session
  • 2e58893 chore: fix types
  • d1fa6bc Merge branch 'canary' into himself65/2025/08/05/session

📊 Changes

4 files changed (+83 additions, -9 deletions)

View changed files

📝 packages/better-auth/src/api/routes/session-api.test.ts (+36 -4)
📝 packages/better-auth/src/db/internal-adapter.ts (+40 -2)
📝 packages/better-auth/src/init.ts (+2 -0)
📝 packages/better-auth/src/utils/logger.ts (+5 -3)

📄 Description

Fixes: https://github.com/better-auth/better-auth/issues/3819


Summary by cubic

Revoked sessions are now removed from the user's active session list, so listing sessions will no longer show revoked tokens.

  • Bug Fixes
    • Updated session deletion to also remove the session from the active sessions record.
    • Added tests to confirm revoked sessions are excluded from active lists.

🔄 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/3820 **Author:** [@himself65](https://github.com/himself65) **Created:** 8/6/2025 **Status:** ✅ Merged **Merged:** 8/6/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `himself65/2025/08/05/session` --- ### 📝 Commits (8) - [`9f0d41a`](https://github.com/better-auth/better-auth/commit/9f0d41aaccbc8ee31873913fb042a717c23f19eb) feat: remove revoked session from active list - [`1721c3e`](https://github.com/better-auth/better-auth/commit/1721c3ea71d8f8aa8c2ea57547fd9c443d05bdb9) feat: remove revoked session from active list - [`df5d411`](https://github.com/better-auth/better-auth/commit/df5d41178912146112f1b928b2be390af6d7b25d) should throw error? - [`a22572e`](https://github.com/better-auth/better-auth/commit/a22572e04caf240fecb8982ab7d7be40f91a5aca) feat: bypass logger - [`27cb738`](https://github.com/better-auth/better-auth/commit/27cb7388f0cc2bb359e76826a70f263587a39b34) test: update - [`d05c55a`](https://github.com/better-auth/better-auth/commit/d05c55a23f4d37a609d2bc0d5cefba0b304a223a) Merge branch 'canary' into himself65/2025/08/05/session - [`2e58893`](https://github.com/better-auth/better-auth/commit/2e58893e54d58bf4ba0aaa92568c4cc65eff8c48) chore: fix types - [`d1fa6bc`](https://github.com/better-auth/better-auth/commit/d1fa6bce518908073360260af894a1eb0c81629f) Merge branch 'canary' into himself65/2025/08/05/session ### 📊 Changes **4 files changed** (+83 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/session-api.test.ts` (+36 -4) 📝 `packages/better-auth/src/db/internal-adapter.ts` (+40 -2) 📝 `packages/better-auth/src/init.ts` (+2 -0) 📝 `packages/better-auth/src/utils/logger.ts` (+5 -3) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/issues/3819 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Revoked sessions are now removed from the user's active session list, so listing sessions will no longer show revoked tokens. - **Bug Fixes** - Updated session deletion to also remove the session from the active sessions record. - Added tests to confirm revoked sessions are excluded from active lists. <!-- 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 12:08:17 -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#5024