message: Fix settings page not displaying sing in properly
diff: @@ -26,9 +26,10 @@ import {
  import {
  ApiRef,
  SessionApi,
  + ProfileInfoApi,
  + ProfileInfo,
  useApi,
  IconComponent,
  - SessionState,
  } from '@backstage/core-plugin-api';
  /** @public */
  @@ -36,21 +37,25 @@ export const ProviderSettingsItem = (props: {
  title: string;
  description: string;
  icon: IconComponent;
  - apiRef: ApiRef<SessionApi>;
  + apiRef: ApiRef<ProfileInfoApi & SessionApi>;
  }) => {
  const { title, description, icon: Icon, apiRef } = props;
  const api = useApi(apiRef);
  const [signedIn, setSignedIn] = useState(false);
  + const [profileEmail, setProfileEmail] = useState('');
  useEffect(() => {
  let didCancel = false;
  - const subscription = api
  - .sessionState$()
  - .subscribe((sessionState: SessionState) => {
  + const subscription = api.sessionState$().subscribe(() => {
  if (!didCancel) {
  - setSignedIn(sessionState === SessionState.SignedIn);
  + api
  + .getProfile({ optional: false })
  + .then((profile: ProfileInfo | undefined) => {
  + setSignedIn(profile !== undefined);
  + setProfileEmail(profile?.email ?? '');
  + });
  }
  });
  @@ -69,7 +74,9 @@ export const ProviderSettingsItem = (props: {
  primary={title}
  secondary={
  <Tooltip placement="top" arrow title={description}>
  - <span>{description}</span>
  + <span>
  + {description}. Signed in as {profileEmail}
  + </span>
  </Tooltip>
  }
  secondaryTypographyProps={{ noWrap: true, style: { width: '80%' } }}
  