From 47d2be2b95496eb80a28cd8866783ed1caddb52a Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Tue, 17 Sep 2024 15:05:22 +0200
Subject: [PATCH] update functions.js

---
 functions.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/functions.js b/functions.js
index 09daebd..a8ba502 100644
--- a/functions.js
+++ b/functions.js
@@ -147,9 +147,6 @@ function showError($sMessage){
  */
 async function checkSession() {
     const url = "/Shibboleth.sso/Session";
-    if(!bShowLoginOnError) {
-        document.getElementById('shib-select-idp').style.display = 'none';
-    }
     try {
         const response = await fetch(url);
         if (!response.ok) {
@@ -159,6 +156,8 @@ async function checkSession() {
             );
             if(bShowLoginOnError) {
                 showFilterBox();
+            } else {
+                document.getElementById('shib-select-idp').style.display = 'none';
             }
             throw new Error(`Response status: ${response.status}`);
         }
@@ -171,6 +170,9 @@ async function checkSession() {
         } else {
             // console.log("Logged in already");
             document.getElementById('shib-check-logged-in').style.display = 'block';
+            if(!bShowLoginOnError) {
+                document.getElementById('shib-select-idp').style.display = 'none';
+            }
         }
 
         // ...
-- 
GitLab