https://github.com/alan2207/epic-stack-with-user-impersonation
An example Remix application showcasing how to implement user impersonation in the Epic Stack.
https://github.com/alan2207/epic-stack-with-user-impersonation
epic-stack epic-stack-example remix user-impersonate
Last synced: 11 months ago
JSON representation
An example Remix application showcasing how to implement user impersonation in the Epic Stack.
- Host: GitHub
- URL: https://github.com/alan2207/epic-stack-with-user-impersonation
- Owner: alan2207
- Created: 2023-07-06T06:24:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-07T16:20:51.000Z (over 2 years ago)
- Last Synced: 2025-03-25T21:22:16.696Z (12 months ago)
- Topics: epic-stack, epic-stack-example, remix, user-impersonate
- Language: TypeScript
- Homepage:
- Size: 10.1 MB
- Stars: 36
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Epic Stack with User Impersonation
User impersonation is a feature that allows admin users to log in as any other
user without knowing their password. This is useful for troubleshooting issues
that a user may be experiencing.
This example demonstrates how to implement this feature in an Epic Stack application.
## Demo:

## How it works
When an admin user wants to impersonate another user, we need to:
- Get the current session ID from the cookie and store it in the session as
`impersonatorSessionId`
- Create a new session for the user we want to impersonate and store it in the
cookie as `sessionId`
When the user stops impersonating, we need to:
- Take the session ID stored in `impersonatorSessionId` and assign it to
`sessionId`, which will restore the original admin session.
- Clear `impersonatorSessionId` from the cookie