From 4a1cef09c2ae708edf6923b0d970d3571cdc31ee Mon Sep 17 00:00:00 2001 From: rv0lt Date: Thu, 7 Nov 2024 17:06:45 +0100 Subject: [PATCH] log the exp as an error only printing the name for possible debug purposes --- SPRINTLOG.md | 2 +- dds_web/security/auth.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SPRINTLOG.md b/SPRINTLOG.md index 1e57bff4a..7b7f070ea 100644 --- a/SPRINTLOG.md +++ b/SPRINTLOG.md @@ -453,4 +453,4 @@ _Nothing merged during this sprint_ # 2024-11-04 - 2024-11-15 -- Catch error of invalid token to avoid logging an exception in the logs ([#1572](https://github.com/ScilifelabDataCentre/dds_web/pull/1572)) +- Remove logging of the exception of incorrect token ([#1572](https://github.com/ScilifelabDataCentre/dds_web/pull/1572)) diff --git a/dds_web/security/auth.py b/dds_web/security/auth.py index 44f55f91f..03c4c9ca9 100644 --- a/dds_web/security/auth.py +++ b/dds_web/security/auth.py @@ -278,6 +278,7 @@ def __verify_general_token(token): # ValueError is raised when the token doesn't look right (for example no periods) # jwcryopto.common.JWException is the base exception raised by jwcrypto, # and is raised when the token is malformed or invalid. + flask.current_app.logger.warning(f"Exception Name: {type(e).__name__}") raise AuthenticationError(message="Invalid token") from e expiration_time = data.get("exp")