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-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>
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user