Fix missing user info on account console (#12962)
* fixes logged in user display reported on issue https://github.com/keycloak/keycloak/issues/12039 * removing unused declaration
This commit is contained in:
parent
1edce54aff
commit
48266fa48f
2 changed files with 5 additions and 5 deletions
|
@ -33,7 +33,6 @@ import { KeycloakContext } from './keycloak-service/KeycloakContext';
|
||||||
|
|
||||||
declare function toggleReact(): void;
|
declare function toggleReact(): void;
|
||||||
declare function isWelcomePage(): boolean;
|
declare function isWelcomePage(): boolean;
|
||||||
declare function loggedInUserName(): string;
|
|
||||||
|
|
||||||
declare const brandImg: string;
|
declare const brandImg: string;
|
||||||
declare const brandUrl: string;
|
declare const brandUrl: string;
|
||||||
|
@ -57,10 +56,6 @@ export class App extends React.Component<AppProps> {
|
||||||
this.context!.login();
|
this.context!.login();
|
||||||
}
|
}
|
||||||
|
|
||||||
const username = (
|
|
||||||
<span style={{marginLeft: '10px'}} id="loggedInUser">{loggedInUserName()}</span>
|
|
||||||
);
|
|
||||||
|
|
||||||
const Header = (
|
const Header = (
|
||||||
<PageHeader
|
<PageHeader
|
||||||
logo={<a id="brandLink" href={brandUrl}><Brand src={brandImg} alt="Logo" className="brand"/></a>}
|
logo={<a id="brandLink" href={brandUrl}><Brand src={brandImg} alt="Logo" className="brand"/></a>}
|
||||||
|
|
|
@ -5,11 +5,14 @@ import {ReferrerLink} from './widgets/ReferrerLink';
|
||||||
import {LogoutButton} from './widgets/Logout';
|
import {LogoutButton} from './widgets/Logout';
|
||||||
|
|
||||||
declare const referrerName: string;
|
declare const referrerName: string;
|
||||||
|
declare function loggedInUserName(): string;
|
||||||
|
|
||||||
export class PageHeaderTool extends React.Component {
|
export class PageHeaderTool extends React.Component {
|
||||||
private hasReferrer: boolean = typeof referrerName !== 'undefined';
|
private hasReferrer: boolean = typeof referrerName !== 'undefined';
|
||||||
|
|
||||||
public render(): React.ReactNode {
|
public render(): React.ReactNode {
|
||||||
|
const username = loggedInUserName();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageHeaderTools>
|
<PageHeaderTools>
|
||||||
{this.hasReferrer &&
|
{this.hasReferrer &&
|
||||||
|
@ -21,6 +24,8 @@ export class PageHeaderTool extends React.Component {
|
||||||
<div className="pf-c-page__header-tools-group">
|
<div className="pf-c-page__header-tools-group">
|
||||||
<LogoutButton/>
|
<LogoutButton/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<span style={{marginLeft: '10px'}} id="loggedInUser">{username}</span>
|
||||||
</PageHeaderTools>
|
</PageHeaderTools>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue