feat(auth): support the __override view-as login (insight#1941) - #220
Conversation
Companion to the authenticator change (constructorfabric/insight#1944) restoring the operator 'view the dashboard as another user' facility: - The historical URL keeps working: '?__override=<email>' on any page is consumed at boot and bounced into /auth/login?__override=...&return_to= (the parameter itself never enters the router). Works while already logged in — the authenticator revokes the presented session at the callback and the IdP hop is silent SSO. - /auth/me's 'impersonator_email' (present only on view-as sessions) is parsed into the session store. - A 'Viewing as X' banner renders above the content on view-as sessions, naming the real principal, with an exit button that just re-logs-in as yourself. The override is honored server-side only where the authenticator's 'override_enabled' flag is on (dev/demo stands); everywhere else the parameter is inert and this UI never shows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Anton Zelenov <antonz@constructor.tech>
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Companion to constructorfabric/insight#1944 (authenticator
__overrideview-as, restoring constructorfabric/insight#1941).?__override=<email>on any page is consumed at boot (src/auth/override.ts, wired inmain.tsxbefore mocks/session/router) and bounced into/auth/login?__override=...&return_to=<page without the param>. Works while already logged in — the authenticator's session-fixation guard revokes the presented session at the callback and the IdP hop is silent SSO./auth/me'simpersonator_email(present only on view-as sessions) is parsed intoSession.impersonatorEmail.view-as-banner.tsx, next to the mock banner in the root layout): names the effective person and the real principal, with an Exit view-as button that simply re-logs-in as yourself.Server-side the override is honored only where the authenticator's
override_enabledflag is on (dev/demo stands); everywhere else the parameter is inert and this UI never renders.Testing
npm test: 686 passed (new:override.test.tsbounce + no-op,session.test.tsimpersonator parsing).npm run typecheck+npm run buildclean.npm run lint: the 3 pre-existing problems ineslint-plugin-local/distare unchanged (present on clean main); no new findings.__overrideis a harmless no-op.🤖 Generated with Claude Code