Skip to content

Commit

Permalink
[Serverless Search] Fix broken API key page (#166368)
Browse files Browse the repository at this point in the history
## Summary

This fixes the create API key flow being broken due to an undefined user
profile.
  • Loading branch information
sphilipse authored Sep 13, 2023
1 parent 170024d commit aac41da
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { CreateApiKeyResponse } from './types';
import './api_key.scss';

export const ApiKeyPanel = ({ setClientApiKey }: { setClientApiKey: (value: string) => void }) => {
const { http, userProfile } = useKibanaServices();
const { http, user } = useKibanaServices();
const [isFlyoutOpen, setIsFlyoutOpen] = useState(false);
const { data } = useQuery({
queryKey: ['apiKey'],
Expand All @@ -49,7 +49,7 @@ export const ApiKeyPanel = ({ setClientApiKey }: { setClientApiKey: (value: stri
<CreateApiKeyFlyout
onClose={() => setIsFlyoutOpen(false)}
setApiKey={saveApiKey}
username={userProfile.user.full_name || userProfile.user.username}
username={user?.full_name || user?.username || ''}
/>
)}
{apiKey ? (
Expand Down

0 comments on commit aac41da

Please sign in to comment.