Update session cookie domain handling in fetchHandler #2
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.
Description
This pull request enhances the session management in the fetchHandler by introducing the ability to set a domain for session cookies. This change ensures that session cookies are correctly scoped to the specified domain, which is particularly useful for cross-domain authentication scenarios. The following updates were made:
domain
option toMyAnimeListHandlerOptions
intypes.ts
.fetchHandler.ts
to include thedomain
parameter when setting and deleting cookies.Reasoning
The update addresses the need for flexible session cookie management across different domains, improving the authentication flow and ensuring consistency in cookie handling. This is particularly important for applications operating in a multi-domain environment, ensuring user sessions are correctly maintained and scoped.
Files changed
fetchHandler.ts
: Added domain parameter to cookie set and delete operations.types.ts
: Introduced domain option inMyAnimeListHandlerOptions
.By incorporating this change, the session management becomes more robust and adaptable to various deployment scenarios.