Updated menu visibility
This commit is contained in:
@@ -47,9 +47,12 @@ import { Tag } from 'primeng/tag';
|
||||
|
||||
@if (keycloak.authenticated) {
|
||||
<p-tag severity="success" value="Authenticated" />
|
||||
@if(keycloak) {
|
||||
<p-tag severity="info" value="Realm: {{ keycloak.realm }}" />
|
||||
}
|
||||
|
||||
@for (item of keycloak.realmAccess?.roles; track $index) {
|
||||
<p-tag severity="info" value="{{ item }}" />
|
||||
<p-tag severity="warn" value="{{ item }}" />
|
||||
}
|
||||
}
|
||||
@if (!keycloak.authenticated) {
|
||||
@@ -104,17 +107,13 @@ import { Tag } from 'primeng/tag';
|
||||
@if (loggedIn) {
|
||||
<div>
|
||||
Logged in as <span
|
||||
class="font-medium text-surface-900 dark:text-surface-0 block mb-2">{{ firstName }} {{ lastName }}</span>
|
||||
class="font-medium text-surface-900 dark:text-surface-0 block mb-2">{{ firstName }} {{ lastName }} <{{ email }}></span>
|
||||
</div>
|
||||
<div>
|
||||
<p-button icon="pi pi-sign-out" label="Logout" severity="danger"
|
||||
(click)="logout()" />
|
||||
</div>
|
||||
}
|
||||
<div>
|
||||
<span class="font-medium text-surface-900 dark:text-surface-0 block mb-2">Team Members</span>
|
||||
...
|
||||
</div>
|
||||
</div>
|
||||
</p-popover>
|
||||
</div>
|
||||
@@ -130,14 +129,18 @@ export class AppTopbar {
|
||||
public loggedIn: boolean = false;
|
||||
public firstName?: string = 'unknown';
|
||||
public lastName?: string = 'unknown';
|
||||
public email?: string = 'unknown';
|
||||
|
||||
|
||||
constructor(public layoutService: LayoutService) {
|
||||
if (this.keycloak.authenticated) {
|
||||
// console.log('KC', this.keycloak);
|
||||
this.loggedIn = true;
|
||||
|
||||
this.keycloak.loadUserProfile().then((userProfile) => {
|
||||
this.firstName = userProfile.firstName;
|
||||
this.lastName = userProfile.lastName;
|
||||
this.email = userProfile.email;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user