From 706e58996e66ec8587aec61e0fbd5ed63c4ae65f Mon Sep 17 00:00:00 2001 From: Tyler Jones Date: Wed, 13 Dec 2023 17:25:40 -0500 Subject: [PATCH] Use this to test PR --- packages/manager/.env.example | 2 ++ .../features/TopMenu/UserMenu/UserMenu.tsx | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/manager/.env.example b/packages/manager/.env.example index db7042d1212..edc822c5b22 100644 --- a/packages/manager/.env.example +++ b/packages/manager/.env.example @@ -11,6 +11,8 @@ REACT_APP_APP_ROOT='http://localhost:3000' REACT_APP_LKE_HIGH_AVAILABILITY_PRICE='60' +REACT_APP_PROXY_PAT='[Add another accounts PAT here]' + ################################## # Optional: ################################## diff --git a/packages/manager/src/features/TopMenu/UserMenu/UserMenu.tsx b/packages/manager/src/features/TopMenu/UserMenu/UserMenu.tsx index d7a7303415a..32640f9d86c 100644 --- a/packages/manager/src/features/TopMenu/UserMenu/UserMenu.tsx +++ b/packages/manager/src/features/TopMenu/UserMenu/UserMenu.tsx @@ -3,6 +3,7 @@ import KeyboardArrowUp from '@mui/icons-material/KeyboardArrowUp'; import { Theme, styled, useMediaQuery } from '@mui/material'; import Popover from '@mui/material/Popover'; import Grid from '@mui/material/Unstable_Grid2'; +import { AxiosHeaders } from 'axios'; import * as React from 'react'; import { Box } from 'src/components/Box'; @@ -15,6 +16,7 @@ import { Stack } from 'src/components/Stack'; import { Tooltip } from 'src/components/Tooltip'; import { Typography } from 'src/components/Typography'; import { useAccountManagement } from 'src/hooks/useAccountManagement'; +import { useProfile } from 'src/queries/profile'; import { useGrants } from 'src/queries/profile'; interface MenuLink { @@ -48,6 +50,24 @@ export const UserMenu = React.memo(() => { profile, } = useAccountManagement(); + const config = { + headers: { + Authorization: `Bearer ${import.meta.env.REACT_APP_PROXY_PAT}`, + }, + }; + const headers = new AxiosHeaders(config.headers); + + const { data: currentProfile } = useProfile(); + console.log( + 'Proxy Account: ', + currentProfile?.username ?? 'No username found' + ); + const { data: parentProfile } = useProfile(undefined, { headers }); + console.log( + 'Proxy Account: ', + parentProfile?.username ?? 'No username found' + ); + const matchesSmDown = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm') );