Remove session end/start from core and provide generic request and response Headers on context instead of node-specific req/res#9579
Draft
emmatown wants to merge 1 commit intopush-oynxlqvlmxwlfrom
Draft
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
7d7e4bc to
c9db964
Compare
c9db964 to
e4d4035
Compare
4e21a90 to
0ac4ef6
Compare
e4d4035 to
a7e0958
Compare
…quest and response on context instead of node-specific
0ac4ef6 to
9ae07bc
Compare
a7e0958 to
49749c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The current Keystone session API that is provided to config looks like this
and then it's provided on the
KeystoneContextassessionStrategy.@keystone-6/coreonly uses thegetfunction though. Thestartandendfunctions are only either used by@keystone-6/author they're called directly by users in their resolvers or etc. If people are using next-auth, passport or etc. thesestartandendfunctions go unused since the session is started/ended elsewhere.So this PR replaces the
SessionStrategywith agetSessionfunction in@keystone-6/coreand theSessionStrategyAPI andstatelessSessionandstoredSessionsimplementations have been moved into@keystone-6/auth.Combined with #9578, this also improves the type-safety & flexibility around sessions with
@keystone-6/authaccepting agetSessionfunction like@keystone-6/coredoes except that it's provideddatawith the item id that the session is for.Supersedes #8097
Stacked on #9578