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): def _authenticate_credentials(self, credentials=None):
# FIXME ':' should a legit char in the password ? shall we encode the password as base64 or something idk try:
if ":" not in credentials or len(credentials.split(":")) != 2: username, password = credentials.split(":", 1)
raise YunohostError("invalid_credentials_format") except ValueError:
raise YunohostError("invalid_credentials")
username, password = credentials.split(":")
def _reconnect(): def _reconnect():
con = ldap.ldapobject.ReconnectLDAPObject( con = ldap.ldapobject.ReconnectLDAPObject(