[GH-ISSUE #435] Admin Plugin suggestions: stopImpersonating() and editUser() #8273

Closed
opened 2026-04-13 03:21:19 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @lucaslevin on GitHub (Nov 6, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/435

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I think it would be a good idea to have admin.stopImpersonating() so admin don't have to logout of impersonated user (or wait for session to end). Also an admin.editUser() as a way of editing a users information.

Describe the solution you'd like
A clear and concise description of what you want to happen.

There is already the impersonatedBy (id) in the useSession(), so it could just be a switch back.

For user edit, it could just use a similar structure as the user.updateUser() but for Admins.

Originally created by @lucaslevin on GitHub (Nov 6, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/435 **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] I think it would be a good idea to have admin.stopImpersonating() so admin don't have to logout of impersonated user (or wait for session to end). Also an admin.editUser() as a way of editing a users information. **Describe the solution you'd like** A clear and concise description of what you want to happen. There is already the impersonatedBy (id) in the useSession(), so it could just be a switch back. For user edit, it could just use a similar structure as the user.updateUser() but for Admins.
GiteaMirror added the locked label 2026-04-13 03:21:19 -05:00
Author
Owner

@Kevinvincentals commented on GitHub (Nov 12, 2024):

What I did was save the admin session in a cookie called admin_session
Then after impersonation - It switches around the session cookies and you are back.
Logic like this should be implemented. +1

<!-- gh-comment-id:2471509429 --> @Kevinvincentals commented on GitHub (Nov 12, 2024): What I did was save the admin session in a cookie called admin_session Then after impersonation - It switches around the session cookies and you are back. Logic like this should be implemented. +1
Author
Owner

@zawasp commented on GitHub (Jan 22, 2025):

It seems "edit user" was not implemented @Bekacru

<!-- gh-comment-id:2608175330 --> @zawasp commented on GitHub (Jan 22, 2025): It seems "edit user" was not implemented @Bekacru
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8273