Dev/demo login experience — quick-login and impersonation for demos #60
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
When demoing the app or running locally with
AUTH_DISABLED=true, we need a smooth way to show different user perspectives without configuring a real OIDC provider.The current state:
AUTH_DISABLED=truebypasses auth entirely with a dummydev-userJWT subjectRequirements
1. Dev login selector page (when
AUTH_DISABLED=true)When auth is disabled, show a login selector page at
/login(or as a landing modal) that lets demo users pick their role:/admin./(customer portal).2. Persistent session indicator
Once logged in as a specific persona, show a small indicator (e.g. top-right badge or bottom bar) showing who you're acting as, with a "Switch user" link back to the selector.
3. API awareness
The API's auth middleware should accept a
X-Dev-User-Idheader (or similar) whenAUTH_DISABLED=trueto let the frontend specify which staff/client record to impersonate. The middleware should look up the staff/client record and inject the appropriate identity into the request context.Security: This MUST only work when
AUTH_DISABLED=true. If auth is enabled, ignoreX-Dev-User-Idcompletely.4. Customer portal integration
The existing impersonation UI in the customer portal can stay, but the new dev login selector is the primary entry point for demos.
Non-goals
Acceptance criteria
AUTH_DISABLED=true, visiting the app shows a role/user selector