diff --git a/ui/litellm-dashboard/src/components/all_keys_table.test.tsx b/ui/litellm-dashboard/src/components/all_keys_table.test.tsx index 201a4be75bd..1458143d77e 100644 --- a/ui/litellm-dashboard/src/components/all_keys_table.test.tsx +++ b/ui/litellm-dashboard/src/components/all_keys_table.test.tsx @@ -93,6 +93,10 @@ const mockKey: KeyResponse = { user_tpm_limit: 1000, user_rpm_limit: 100, user_email: "user@example.com", + user: { + user_email: "user@example.com", + user_id: "user-1", + }, }; const mockTeam: Team = { @@ -190,3 +194,35 @@ it("should display key information correctly", async () => { expect(screen.getByText("5.5000")).toBeInTheDocument(); }); }); + +it("should display user email correctly", async () => { + const mockProps = { + keys: [mockKey], + setKeys: vi.fn(), + isLoading: false, + pagination: { + currentPage: 1, + totalPages: 1, + totalCount: 1, + }, + onPageChange: vi.fn(), + pageSize: 50, + teams: [mockTeam], + selectedTeam: null, + setSelectedTeam: vi.fn(), + selectedKeyAlias: null, + setSelectedKeyAlias: vi.fn(), + accessToken: "test-token", + userID: "user-1", + userRole: "admin", + organizations: [mockOrganization], + setCurrentOrg: vi.fn(), + premiumUser: false, + }; + + renderWithProviders(); + + await waitFor(() => { + expect(screen.getByText("user@example.com")).toBeInTheDocument(); + }); +}); diff --git a/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx b/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx index 9f95ba46cc1..a04fbf3943d 100644 --- a/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx +++ b/ui/litellm-dashboard/src/components/key_team_helpers/key_list.tsx @@ -91,6 +91,10 @@ export interface KeyResponse { last_rotation_at?: string; key_rotation_at?: string; next_rotation_at?: string; + user?: { + user_id: string; + user_email: string; + }; } interface KeyListResponse {