Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Fixes #1420
The current implementation of
validateAuthenticatedSession
does not handle CORS preflightOPTIONS
requests properly. These requests are being blocked by the authentication middleware, causing issues with cross-origin resource sharing.WHAT is this pull request doing?
This pull request introduces handling for preflight
OPTIONS
requests in thevalidateAuthenticatedSession
middleware. The change ensures that preflight requests bypass authentication checks and respond with the appropriate CORS headers, fixing the issue of blocked preflight requests.Additionally, TypeScript documentation (TSDoc) has been added to the middleware and related functions to provide clarity on their purpose and functionality.
Changes include:
OPTIONS
requests within the middleware.200 OK
status for preflight requests.Type of change
Checklist
pnpm changeset
to create a draft changelog entry (do NOT update theCHANGELOG.md
files manually)