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()