diff --git a/py/visdom/utils/server_utils.py b/py/visdom/utils/server_utils.py index fb7f0415d..cc6962bbd 100644 --- a/py/visdom/utils/server_utils.py +++ b/py/visdom/utils/server_utils.py @@ -53,8 +53,9 @@ def _check_auth(handler, *args, **kwargs): # TODO this should call a shared method of the handler handler.last_access = time.time() if handler.login_enabled and not handler.current_user: - handler.set_status(400) - return + handler.set_status(401) + handler.write({"error": "Authentication required"}) + return f(handler, *args, **kwargs) return _check_auth