diff --git a/deluge/core/authmanager.py b/deluge/core/authmanager.py index 120481c3c..ad1f09de8 100644 --- a/deluge/core/authmanager.py +++ b/deluge/core/authmanager.py @@ -72,6 +72,16 @@ class AuthManager(component.Component): pass def peek(self, username): + """ + Peeks users based on username and returns their auth level + + :param username: str, username + :returns: int, the auth level for this user + :rtype: int + + :raises BadLoginError: if the username does not exist or password does not match + + """ if username not in self.__auth: # Let's try to re-load the file.. Maybe it's been updated self.__load_auth_file() diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py index 9620c7b81..7d6033e24 100644 --- a/deluge/core/rpcserver.py +++ b/deluge/core/rpcserver.py @@ -254,6 +254,9 @@ class DelugeRPCProtocol(Protocol): )) if method == "daemon.peek": + # This is a special case and used in the initial connection process + # We need to peek the user here in order to get an auth level back + # and see if the user exists. try: ret = component.get("AuthManager").peek(*args, **kwargs) if ret: