From d5c4ff1ea29b6af89763c77882454be74d7eda33 Mon Sep 17 00:00:00 2001
From: Tim van Dijen <tvdijen@gmail.com>
Date: Sat, 4 Sep 2021 14:28:30 +0200
Subject: [PATCH] Fix: selecting the first organization would not work, because
 of incorrect test

---
 modules/core/www/loginuserpassorg.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/core/www/loginuserpassorg.php b/modules/core/www/loginuserpassorg.php
index 295650dcd..44f5d39c9 100644
--- a/modules/core/www/loginuserpassorg.php
+++ b/modules/core/www/loginuserpassorg.php
@@ -66,7 +66,7 @@ if (isset($state['error'])) {
     $queryParams = ['AuthState' => $authStateId];
 }
 
-if ($organizations === null || !empty($organization)) {
+if ($organizations === null || $organization !== '') {
     if (!empty($username) || !empty($password)) {
         if ($source->getRememberUsernameEnabled()) {
             $sessionHandler = \SimpleSAML\SessionHandler::getSessionHandler();
-- 
GitLab