feat: show organization username in impersonation banner#24313
feat: show organization username in impersonation banner#24313hariombalhara merged 3 commits intomainfrom
Conversation
- Update ImpersonatingBanner to use orgAwareUsername field from session - Falls back to regular username for non-organization users - Uses existing session data without additional queries Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
WalkthroughThe impersonation banner text in packages/features/ee/impersonation/components/ImpersonatingBanner.tsx was updated to display data.user.orgAwareUsername when available, with a fallback to data.user.username. This change only affects the string passed to the TopBanner text prop and does not modify any other logic or control flow. Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (3)**/*.tsx📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/review.mdc)
Files:
**/*.{ts,tsx,js,jsx}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (1)
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
E2E results are ready! |
- Update ImpersonatingBanner to use orgAwareUsername field from session - Falls back to regular username for non-organization users - Uses existing session data without additional queries Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
What does this PR do?
Updates the impersonation banner to display the organization-aware username (
orgAwareUsername) instead of the regular username when impersonating organization members. This ensures that when impersonating a user who belongs to an organization, their organization-specific username is shown in the banner rather than their global username.Global username doesn't have any use as long as user is part of organization
For owner1 member of Acme org, now we show the username in the Organization

Before:
After:

Link to Devin run: https://app.devin.ai/sessions/8b52f231e47f48b59c1a29d96ae44b2a
Requested by: @hariombalhara
Implementation Details
packages/features/ee/impersonation/components/ImpersonatingBanner.tsxdata.user.orgAwareUsername || data.user.usernameinstead ofdata.user.usernameorgAwareUsername) that's already populated during JWT token creationMandatory Tasks (DO NOT REMOVE)
How should this be tested?
Setup Requirements:
Test Scenarios:
Expected Behavior:
Key Review Points
orgAwareUsernamecontains the expected organization username (not global username)usernameInOrgChecklist