From 4d1ccba5aa891207948dbd66b3a9281e57ae02cd Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 2 Jun 2020 11:38:07 +0200
Subject: [PATCH] Don't show the profile image by default

---
 packages/auth/src/auth.js          | 5 +++--
 packages/auth/src/vpu-auth-demo.js | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/packages/auth/src/auth.js b/packages/auth/src/auth.js
index 683c61c9..a3814957 100644
--- a/packages/auth/src/auth.js
+++ b/packages/auth/src/auth.js
@@ -39,6 +39,7 @@ export class Auth extends ScopedElementsMixin(VPULitElement) {
         this.forceLogin = false;
         this.loadPerson = false;
         this.showProfile = false;
+        this.showImage = false;
         this.token = "";
         this.tokenParsed = null;
         this.subject = "";
@@ -174,6 +175,7 @@ export class Auth extends ScopedElementsMixin(VPULitElement) {
             tryLogin: { type: Boolean, attribute: 'try-login' },
             loadPerson: { type: Boolean, attribute: 'load-person' },
             showProfile: { type: Boolean, attribute: 'show-profile' },
+            showImage: { type: Boolean, attribute: 'show-image' },
             entryPointUrl: { type: String, attribute: 'entry-point-url' },
             keycloakConfig: { type: Object, attribute: 'keycloak-config' },
             name: { type: String, attribute: false },
@@ -315,7 +317,6 @@ export class Auth extends ScopedElementsMixin(VPULitElement) {
             .dropdown-menu {
                 display: none;
                 min-width: 8em;
-                padding-top: 4px;
                 position: absolute;
                 z-index: 20;
                 border: solid 1px black;
@@ -443,7 +444,7 @@ export class Auth extends ScopedElementsMixin(VPULitElement) {
     }
 
     renderLoggedIn() {
-        const imageURL = (this.person && this.person.image) ? this.person.image : null;
+        const imageURL = (this.showImage && this.person && this.person.image) ? this.person.image : null;
 
         return html`
             <div class="dropdown" @click="${this.onDropdownClick}">
diff --git a/packages/auth/src/vpu-auth-demo.js b/packages/auth/src/vpu-auth-demo.js
index 05a9c2e5..fffcd045 100644
--- a/packages/auth/src/vpu-auth-demo.js
+++ b/packages/auth/src/vpu-auth-demo.js
@@ -84,7 +84,7 @@ class AuthDemo extends ScopedElementsMixin(LitElement) {
                     <h1 class="title">Auth-Demo</h1>
                 </div>
                 <div class="container">
-                    <vpu-auth lang="${this.lang}" keycloak-config='{"url": "https://auth-dev.tugraz.at/auth", "realm": "tugraz", "clientId": "auth-dev-mw-frontend-local", "silentCheckSsoRedirectUri": "${silentCheckSsoUri}", "scope": "optional-test-scope"}' load-person try-login></vpu-auth>
+                    <vpu-auth lang="${this.lang}" keycloak-config='{"url": "https://auth-dev.tugraz.at/auth", "realm": "tugraz", "clientId": "auth-dev-mw-frontend-local", "silentCheckSsoRedirectUri": "${silentCheckSsoUri}", "scope": "optional-test-scope"}' load-person try-login show-image></vpu-auth>
                 </div>
             </section>
 
-- 
GitLab