Log failed login attempts

This commit is contained in:
Fabian Affolter 2016-03-15 23:38:46 +01:00
parent 1f7e0936fa
commit c865ff852d

View file

@ -237,9 +237,10 @@ class RequestHandler(SimpleHTTPRequestHandler):
# Did we find a handler for the incoming request?
if handle_request_method:
# For some calls we need a valid password
msg = "API password missing or incorrect."
if require_auth and not self.authenticated:
self.write_json_message(
"API password missing or incorrect.", HTTP_UNAUTHORIZED)
self.write_json_message(msg, HTTP_UNAUTHORIZED)
_LOGGER.warning(msg)
return
handle_request_method(self, path_match, data)