Skip to content

Commit

Permalink
log the exp as an error only printing the name for possible debug pur…
Browse files Browse the repository at this point in the history
…poses
  • Loading branch information
rv0lt committed Nov 7, 2024
1 parent 53b6593 commit 4a1cef0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SPRINTLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
1 change: 1 addition & 0 deletions dds_web/security/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4a1cef0

Please sign in to comment.