Conversation
There was a problem hiding this comment.
Bug: Null Token Handling in `setCookie` Function
The setCookie function uses jwt.decode() for accessToken and refreshToken without null checking. If a token is malformed, jwt.decode() returns null, causing a runtime TypeError (e.g., "Cannot read property 'exp' of null") when attempting to access the .exp property to determine cookie expiration. This can lead to application crashes when setting authentication cookies.
src/common/utils/cookie.ts#L83-L101
matters-server/src/common/utils/cookie.ts
Lines 83 to 101 in 5ab38e6
Was this report helpful? Give feedback by reacting with 👍 or 👎
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #4582 +/- ##
===========================================
- Coverage 56.40% 55.71% -0.70%
===========================================
Files 973 975 +2
Lines 19074 19179 +105
Branches 4032 4052 +20
===========================================
- Hits 10759 10685 -74
- Misses 7575 7730 +155
- Partials 740 764 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Reverts #4581