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 2 commits 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 2 times, most recently from 18766d3 to f3c4154 Compare May 8, 2025 22:25
@codecov-commenter
Copy link

Codecov Report

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

Project coverage is 82.42%. Comparing base (c44432c) to head (be964d6).

Files with missing lines Patch % Lines
src/server/session/stateful-session-store.ts 94.11% 1 Missing ⚠️
src/server/session/stateless-session-store.ts 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2082      +/-   ##
==========================================
+ Coverage   82.05%   82.42%   +0.37%     
==========================================
  Files          21       21              
  Lines        1967     1992      +25     
  Branches      343      352       +9     
==========================================
+ Hits         1614     1642      +28     
+ Misses        347      344       -3     
  Partials        6        6              

☔ 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.

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