Impersonation
ImpersonationSwitcher
Modal dialog for selecting a user to impersonate in an admin session.
ImpersonationSwitcher
Renders a modal with a searchable user list, allowing an admin to select any user account to impersonate. Initiates the impersonation session on confirm and redirects to the app as that user.
Components
<XAdminImpersonationSwitcher />
Displays a searchable user picker modal with a confirm action to start impersonating the selected user.
<XAdminImpersonationSwitcher v-model:open="open" />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
open | boolean | false | Controls modal visibility (use v-model:open) |
endpoint | string | '/api/admin/impersonation' | Base API endpoint |
usersEndpoint | string | '/api/admin/users' | API endpoint to search users |
redirectTo | string | '/' | Path to redirect to after starting impersonation |
searchable | boolean | true | Enable user search in the picker |
AI Context
component: XAdminImpersonationSwitcher
package: "@xenterprises/nuxt-x-app-admin"
category: Impersonation
use-when: Opening a modal to search for and select a user to impersonate in an admin session
