From: Magnus Hagander Date: Wed, 11 Jun 2025 18:47:16 +0000 (+0200) Subject: Set status 400 on oauth exceptions X-Git-Url: http://git.postgresql.org/gitweb/delmail?a=commitdiff_plain;h=7959b229ee7b85e3880607490e068f1ab8a70799;p=pgweb.git Set status 400 on oauth exceptions It's not always entirely correct, but it's less wrong than 200. --- 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')