From 3e482470b6b5c429e6aa61d9f4b34c74d60e86ba Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Thu, 8 Feb 2024 18:33:35 +0100 Subject: [PATCH] Add provider info --- .../components/user-menu/user-menu.component.html | 3 +++ .../fm/components/user-menu/user-menu.component.ts | 13 ++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/projects/common/src/fm/components/user-menu/user-menu.component.html b/projects/common/src/fm/components/user-menu/user-menu.component.html index 50fc52d..e1ed13e 100644 --- a/projects/common/src/fm/components/user-menu/user-menu.component.html +++ b/projects/common/src/fm/components/user-menu/user-menu.component.html @@ -5,6 +5,9 @@
{{user.name}}
+
+ Provider {{provider}} +
logout
diff --git a/projects/common/src/fm/components/user-menu/user-menu.component.ts b/projects/common/src/fm/components/user-menu/user-menu.component.ts index 2e9adb5..4b3565b 100644 --- a/projects/common/src/fm/components/user-menu/user-menu.component.ts +++ b/projects/common/src/fm/components/user-menu/user-menu.component.ts @@ -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) {