Add provider info
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good Details

develop
Willem Dantuma 2024-02-08 18:33:35 +01:00
parent 3bacb8a5d9
commit 3e482470b6
2 changed files with 11 additions and 5 deletions

View File

@ -5,6 +5,9 @@
<div class="card" *ngIf="user">
<div class="card-body">
<div class="username">{{user.name}}</div>
<div *ngIf="getProvider(); let provider">
<small><span i18n>Provider</span><span> </span><span>{{provider}}</span></small>
</div>
<div><a href="#" (click)="logout($event)" i18n>logout</a></div>
</div>
</div>

View File

@ -20,11 +20,14 @@ export class UserMenuComponent implements OnInit {
ngOnInit(): void {
}
getLetter():string {
if (this.user && this.user.firstName && this.user.lastName)
return this.user.firstName.substr(0,1).toUpperCase() +
this.user.lastName.substr(0,1).toUpperCase();
return this.user && this.user.name ? this.user.name.substr(0,1).toUpperCase():"";
getProvider():string | null {
const ownedClaims = this.oauthService.getIdentityClaims();
if(ownedClaims) {
if (ownedClaims["idp"] != "local") {
return ownedClaims["idp"];
}
}
return null;
}
logout(event:MouseEvent) {