From 88c53f3510f29fc554ad6ee86718bfa9337a50a2 Mon Sep 17 00:00:00 2001 From: Kevin Chung Date: Thu, 25 Mar 2021 11:59:59 -0400 Subject: [PATCH] Make expired token error message more useful (#1851) * Make expired token error message more useful --- CHANGELOG.md | 1 + CTFd/utils/initialization/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21df1490..c1c73c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Fix issue where `PATCH /api/v1/users[user_id]` returned a list instead of a dict - Fix exception that occured on demoting admins through `PATCH /api/v1/users[user_id]` - Add `team_id` to `GET /api/v1/users` to determine if a user is already in a team +- Provide a more useful error message when using an expired token **Themes** diff --git a/CTFd/utils/initialization/__init__.py b/CTFd/utils/initialization/__init__.py index b0e7187c..20fbde00 100644 --- a/CTFd/utils/initialization/__init__.py +++ b/CTFd/utils/initialization/__init__.py @@ -267,7 +267,7 @@ def init_request_processors(app): except UserNotFoundException: abort(401) except UserTokenExpiredException: - abort(401) + abort(401, description="Your access token has expired") except Exception: abort(401) else: