X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FAuth.py;fp=PLC%2FAuth.py;h=c1684b598e02bae91853b99e23aaf4c48503253f;hb=da5f40b50a37db4b4c8d63346724649813647e05;hp=33f60c24059bdb4469e31bd3e1659ee10ac9375e;hpb=f9b4cbd4cee0c41047fb6a140bb50e8cc1f79b55;p=plcapi.git diff --git a/PLC/Auth.py b/PLC/Auth.py index 33f60c2..c1684b5 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -23,7 +23,7 @@ from PLC.Sessions import Session, Sessions from PLC.Peers import Peer, Peers from PLC.Keys import Keys from PLC.Boot import notify_owners - +from PLC.Logger import logger class Auth(Parameter): """ @@ -299,9 +299,11 @@ class PasswordAuth(Auth): assert 'Username' in auth # Get record (must be enabled) + normalized = auth['Username'].lower() persons = Persons(method.api, { - 'email': auth['Username'].lower(), 'enabled': True, 'peer_id': None}) + 'email': normalized, 'enabled': True, 'peer_id': None}) if len(persons) != 1: + logger.info(f"PasswordAuth failed with {normalized}, got {len(persons)} matches") raise PLCAuthenticationFailure("PasswordAuth: No such account") person = persons[0]