From 8e69733cf6b2510df7bffe9d6660ef50db4078f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Wed, 3 May 2023 08:05:28 +0800 Subject: [PATCH] Updated the login_required view decorator of the DigestAuth class, replaced writing to STDERR directly with warning through the Flask logger. --- src/flask_digest_auth/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flask_digest_auth/auth.py b/src/flask_digest_auth/auth.py index e4d0c54..981daec 100644 --- a/src/flask_digest_auth/auth.py +++ b/src/flask_digest_auth/auth.py @@ -140,7 +140,7 @@ class DigestAuth: return view(*args, **kwargs) except UnauthorizedException as e: if len(e.args) > 0: - sys.stderr.write(e.args[0] + "\n") + current_app.logger.warning(e.args[0]) response: Response = Response() response.status = 401 response.headers["WWW-Authenticate"] \