Skip to content

feat: Pomerium assertion headers used in UI now to display user info#42

Merged
wasaga merged 5 commits intomainfrom
nickytonline/pomerium-assertion-header
Jun 3, 2025
Merged

feat: Pomerium assertion headers used in UI now to display user info#42
wasaga merged 5 commits intomainfrom
nickytonline/pomerium-assertion-header

Conversation

@nickytonline
Copy link
Copy Markdown
Member

@nickytonline nickytonline commented Jun 3, 2025

  • Added UserContext using @pomerium/js-sdk to extract Pomerium assertion headers.
  • Updated Chat component to greet user by name, similar to Claude.
  • Enhanced Header to show user's email and profile picture.
  • Wrapped app in UserProvider for global access to user identity.
  • Added @pomerium/js-sdk to package.json and lockfile.

CleanShot 2025-06-02 at 21 23 01@2x

For the avatar URL, I was looking at the Enterprise Console source code and we handle it differently @wasaga and we seem to extend the UserInfo with some getters/setters. We can chat tomorrow when you're in SF.

Closes #41

- Added UserContext using @pomerium/js-sdk to extract Pomerium assertion headers.
- Updated Chat component to greet user by name, similar to Claude.
- Enhanced Header to show user's email and profile picture.
- Wrapped app in UserProvider for global access to user identity.
- Added @pomerium/js-sdk to package.json and lockfile.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds Pomerium-based user identity to the UI and personalizes components accordingly

  • Introduces UserContext to fetch and provide user info via @pomerium/js-sdk
  • Wraps the app in UserProvider and updates Header and Chat to display name, email, and avatar
  • Adds @pomerium/js-sdk dependency

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/routes/__root.tsx Wrapped <ModelProvider> in <UserProvider>
src/contexts/UserContext.tsx New context to fetch and expose Pomerium user info
src/components/Header.tsx Displays user’s email, name, and profile picture in the header
src/components/Chat.tsx Personalizes initial chat greeting with the user’s first name
package.json Added @pomerium/js-sdk dependency
Comments suppressed due to low confidence (2)

src/contexts/UserContext.tsx:36

  • [nitpick] Using a generic ['user'] key can collide with other queries. Rename to ['userInfo'] or similar to make it more specific.
queryKey: ['user'],

src/contexts/UserContext.tsx:20

  • Core logic in fetchUserInfo and UserProvider lacks unit tests. Add tests to verify fallback behavior and error handling of getBrowserUser.
async function fetchUserInfo(): Promise<UserInfo> {

Comment thread src/contexts/UserContext.tsx
Comment thread src/contexts/UserContext.tsx Outdated
Comment thread src/components/Header.tsx
Comment thread src/components/Chat.tsx Outdated
@nickytonline nickytonline changed the title feat: display user's name from Pomerium identity in UI feat: Pomerium assertion headers used in UI now to display user info Jun 3, 2025
@wasaga wasaga merged commit 1b46023 into main Jun 3, 2025
1 check passed
@wasaga wasaga deleted the nickytonline/pomerium-assertion-header branch June 3, 2025 13:00
nickytonline added a commit that referenced this pull request Jun 11, 2025
…42)

- Added UserContext using @pomerium/js-sdk to extract Pomerium assertion
headers.
- Updated Chat component to greet user by name, similar to Claude.
- Enhanced Header to show user's email and profile picture.
- Wrapped app in UserProvider for global access to user identity.
- Added @pomerium/js-sdk to package.json and lockfile.

![CleanShot 2025-06-02 at 21 23
01@2x](https://github.com/user-attachments/assets/b16f493e-8cd4-49e7-bd4b-d7b0ca3de6cb)

For the avatar URL, I was looking at the Enterprise Console source code
and we handle it differently @wasaga and we seem to extend the UserInfo
with some getters/setters. We can chat tomorrow when you're in SF.

Closes #41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: demonstrate the pomerium assertion header

3 participants