From 5474e668539729af3fd8d3434b44d85610643157 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 24 Apr 2024 07:50:46 +0300 Subject: Fetch message for authlib errors. --- gn2/wqflask/oauth2/request_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gn2/wqflask') diff --git a/gn2/wqflask/oauth2/request_utils.py b/gn2/wqflask/oauth2/request_utils.py index a453d18e..f92a7f57 100644 --- a/gn2/wqflask/oauth2/request_utils.py +++ b/gn2/wqflask/oauth2/request_utils.py @@ -35,7 +35,8 @@ def process_error(error: Response, if error.status_code in range(400, 500): try: err = error.json() - msg = err.get("error_description", f"{error.reason}") + msg = error.get( + "error", err.get("error_description", f"{error.reason}")) except simplejson.errors.JSONDecodeError as _jde: msg = message return { -- cgit v1.2.3