portalapi: fix split or user/password in auth code

This commit is contained in:
Alexandre Aubin 2023-07-11 17:49:25 +02:00
parent a1cf770e1b
commit 9a5080ea16

View file

@ -27,11 +27,10 @@ class Authenticator(BaseAuthenticator):
def _authenticate_credentials(self, credentials=None):
# FIXME ':' should a legit char in the password ? shall we encode the password as base64 or something idk
if ":" not in credentials or len(credentials.split(":")) != 2:
raise YunohostError("invalid_credentials_format")
username, password = credentials.split(":")
try:
username, password = credentials.split(":", 1)
except ValueError:
raise YunohostError("invalid_credentials")
def _reconnect():
con = ldap.ldapobject.ReconnectLDAPObject(