From 6aaf47493d0cc26e617fe3fc6f9fe589a98666ad Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 23 Dec 2021 16:55:12 +0100 Subject: [PATCH] Not sure when that started to happen, but bottle will return an empty dict if no valid session cookie found, this shall trigger an exception --- src/authenticators/ldap_admin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/authenticators/ldap_admin.py b/src/authenticators/ldap_admin.py index 26843c2c1..7f96165cb 100644 --- a/src/authenticators/ldap_admin.py +++ b/src/authenticators/ldap_admin.py @@ -109,6 +109,9 @@ class Authenticator(BaseAuthenticator): return {"id": random_ascii()} raise YunohostAuthenticationError("unable_authenticate") + if not infos and raise_if_no_session_exists: + raise YunohostAuthenticationError("unable_authenticate") + if "id" not in infos: infos["id"] = random_ascii()