From 7959b229ee7b85e3880607490e068f1ab8a70799 Mon Sep 17 00:00:00 2001 From: Magnus Hagander Date: Wed, 11 Jun 2025 20:47:16 +0200 Subject: [PATCH] Set status 400 on oauth exceptions It's not always entirely correct, but it's less wrong than 200. --- pgweb/account/oauthclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pgweb/account/oauthclient.py b/pgweb/account/oauthclient.py index 8398cbe0..283e5621 100644 --- a/pgweb/account/oauthclient.py +++ b/pgweb/account/oauthclient.py @@ -372,7 +372,7 @@ def _oauth_login_dispatch(provider, request): try: return getattr(m, fn)(request) except OAuthException as e: - return HttpResponse(e) + return HttpResponse(e, status=400) except Exception as e: log.error('Exception during OAuth: {}'.format(e)) return HttpResponse('An unhandled exception occurred during the authentication process') -- 2.39.5