[PR #6568] [MERGED] fix(admin): clear admin session cookie on stopImpersonating #14996

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6568
Author: @jslno
Created: 12/6/2025
Status: Merged
Merged: 12/6/2025
Merged by: @Bekacru

Base: canaryHead: 12-06-2025/clear-admin-session-cookie


📝 Commits (4)

  • 2f1b145 fix(admin): clear admin session cookie on stopImpersonating
  • 814779b chore: cleanup
  • b5d9656 Merge branch 'canary' into 12-06-2025/clear-admin-session-cookie
  • fa8ce15 chore: fix linting

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/plugins/admin/routes.ts (+4 -0)

📄 Description

closes #6567


Summary by cubic

Clear the admin session cookie when an admin stops impersonating to fully end the session and prevent lingering auth state. The route now deletes the signed admin cookie by setting an empty value with immediate expiry.

Written for commit fa8ce158a5. 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/6568 **Author:** [@jslno](https://github.com/jslno) **Created:** 12/6/2025 **Status:** ✅ Merged **Merged:** 12/6/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `12-06-2025/clear-admin-session-cookie` --- ### 📝 Commits (4) - [`2f1b145`](https://github.com/better-auth/better-auth/commit/2f1b145d85fd268c46c592da2957c517644bc135) fix(admin): clear admin session cookie on `stopImpersonating` - [`814779b`](https://github.com/better-auth/better-auth/commit/814779b07da2e43a7c42d22789064b8fd4bb1742) chore: cleanup - [`b5d9656`](https://github.com/better-auth/better-auth/commit/b5d9656023dc08203927b563bb3e2504e5a434d7) Merge branch 'canary' into 12-06-2025/clear-admin-session-cookie - [`fa8ce15`](https://github.com/better-auth/better-auth/commit/fa8ce158a538f9ebded41c242a77eaf117ea8e43) chore: fix linting ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/admin/routes.ts` (+4 -0) </details> ### 📄 Description closes #6567 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Clear the admin session cookie when an admin stops impersonating to fully end the session and prevent lingering auth state. The route now deletes the signed admin cookie by setting an empty value with immediate expiry. <sup>Written for commit fa8ce158a538f9ebded41c242a77eaf117ea8e43. 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:45:39 -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#14996