Impersonation
ImpersonationBanner
Warning banner displayed when an admin is actively impersonating a user.
ImpersonationBanner
Renders a persistent warning banner at the top of the page when an admin session is impersonating another user, displaying the impersonated user's name and a "Stop Impersonating" button to end the session.
Components
<XAdminImpersonationBanner />
Displays a prominent colored banner with the impersonated user's identity and a stop-impersonation action. Should be placed in the app layout so it appears on every page during an impersonation session.
<XAdminImpersonationBanner />
Props
| Prop | Type | Default | Description |
|---|---|---|---|
endpoint | string | '/api/admin/impersonation' | Base API endpoint |
color | string | 'yellow' | Banner background color (tailwind color name) |
showUser | boolean | true | Display the impersonated user's name and email |
autoHide | boolean | false | Hide banner when not impersonating (uses v-if internally) |
AI Context
component: XAdminImpersonationBanner
package: "@xenterprises/nuxt-x-app-admin"
category: Impersonation
use-when: Showing a persistent warning to admins that they are currently impersonating another user, with a stop action
