Skip to content

fix: correctly handle expired JWE's in cookies #2082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frederikprijck
Copy link
Member

📋 Changes

We ensured JWE's expire in #2040 , this has the side-effect that when an expired token hits the API, it would throw a 500 because it can not encrypt the JWE due to the expiration.

Instead of this, it should act as if there is no active session.

📎 References

#2081

🎯 Testing

  1. Obtain an expired JWT
  2. Hit the Next.js server wired up with the Auth0 middleware
  3. Boom, HTTP 500

@frederikprijck frederikprijck force-pushed the fix/handle-expired branch 3 times, most recently from f3c4154 to af39cb4 Compare May 8, 2025 22:27
@codecov-commenter
Copy link

codecov-commenter commented May 8, 2025

Codecov Report

Attention: Patch coverage is 96.07843% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.02%. Comparing base (0fdcd13) to head (bdac51a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/server/session/stateful-session-store.ts 93.75% 1 Missing ⚠️
src/server/session/stateless-session-store.ts 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2082      +/-   ##
==========================================
+ Coverage   82.66%   83.02%   +0.35%     
==========================================
  Files          21       21              
  Lines        2060     2085      +25     
  Branches      362      371       +9     
==========================================
+ Hits         1703     1731      +28     
+ Misses        350      347       -3     
  Partials        7        7              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@frederikprijck frederikprijck force-pushed the fix/handle-expired branch 3 times, most recently from dff77c5 to 8dc270f Compare June 16, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants