From e2c8ae242788bed48f2746e77fa4e4eb9bd5e316 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Thu, 28 Nov 2019 11:03:25 +0100
Subject: [PATCH] Add an attribute to display the profile link and disable it
 by default

We don't need it in all cases.
---
 packages/auth/src/vpu-auth.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/packages/auth/src/vpu-auth.js b/packages/auth/src/vpu-auth.js
index c5690567..406f68f3 100644
--- a/packages/auth/src/vpu-auth.js
+++ b/packages/auth/src/vpu-auth.js
@@ -36,6 +36,7 @@ class VPUAuth extends VPULitElement {
         this.lang = 'de';
         this.forceLogin = false;
         this.loadPerson = false;
+        this.showProfile = false;
         this.clientId = "";
         this.token = "";
         this.subject = "";
@@ -147,6 +148,7 @@ class VPUAuth extends VPULitElement {
             loadPerson: { type: Boolean, attribute: 'load-person' },
             clientId: { type: String, attribute: 'client-id' },
             silentCheckSsoUri: { type: String, attribute: 'silent-check-sso-uri' },
+            showProfile: { type: Boolean, attribute: 'show-profile' },
             name: { type: String, attribute: false },
             token: { type: String, attribute: false },
             subject: { type: String, attribute: false },
@@ -378,7 +380,7 @@ class VPUAuth extends VPULitElement {
                     <div class="dropdown-content">
                         ${imageURL ? html`<img alt="" src="${imageURL}" class="dropdown-item">` : ''}
                         <div class="menu">
-                            <a href="#" @click="${this.onProfileClicked}" class="dropdown-item">${i18n.t('profile')}</a>
+                            ${this.showProfile ? html`<a href="#" @click="${this.onProfileClicked}" class="dropdown-item">${i18n.t('profile')}</a>` :''}
                             <a href="#" @click="${this.onLogoutClicked}" class="dropdown-item">${i18n.t('logout')}</a>
                         </div>
                     </div>
-- 
GitLab