From d9d7ff0825e4c5fbed6564d3684374bf3937df11 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Thu, 8 May 2025 20:07:16 +0100 Subject: [PATCH] use async error handlers in auth module (Fixes #298) --- src/microdot/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microdot/auth.py b/src/microdot/auth.py index a6536c2..71574ee 100644 --- a/src/microdot/auth.py +++ b/src/microdot/auth.py @@ -85,7 +85,7 @@ class BasicAuth(BaseAuth): return None return username, password - def authentication_error(self, request): + async def authentication_error(self, request): return '', self.error_status, { 'WWW-Authenticate': '{} realm="{}", charset="{}"'.format( self.scheme, self.realm, self.charset)} @@ -158,5 +158,5 @@ class TokenAuth(BaseAuth): """ self.error_callback = f - def authentication_error(self, request): + async def authentication_error(self, request): abort(self.error_status)