Add provider info
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
parent
3bacb8a5d9
commit
3e482470b6
@ -5,6 +5,9 @@
|
|||||||
<div class="card" *ngIf="user">
|
<div class="card" *ngIf="user">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="username">{{user.name}}</div>
|
<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><a href="#" (click)="logout($event)" i18n>logout</a></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -20,11 +20,14 @@ export class UserMenuComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
getLetter():string {
|
getProvider():string | null {
|
||||||
if (this.user && this.user.firstName && this.user.lastName)
|
const ownedClaims = this.oauthService.getIdentityClaims();
|
||||||
return this.user.firstName.substr(0,1).toUpperCase() +
|
if(ownedClaims) {
|
||||||
this.user.lastName.substr(0,1).toUpperCase();
|
if (ownedClaims["idp"] != "local") {
|
||||||
return this.user && this.user.name ? this.user.name.substr(0,1).toUpperCase():"";
|
return ownedClaims["idp"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
logout(event:MouseEvent) {
|
logout(event:MouseEvent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user