Closed SleeplessOne1917 closed 1 year ago
Latest commit: 93af093cba76cc153b0e2045bfba74d17798633c
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Merging #375 (93af093) into master (5615e7d) will increase coverage by
0.03%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #375 +/- ##
==========================================
+ Coverage 99.17% 99.20% +0.03%
==========================================
Files 6 6
Lines 121 126 +5
Branches 37 41 +4
==========================================
+ Hits 120 125 +5
Misses 1 1
Impacted Files | Coverage Δ | |
---|---|---|
src/types.ts | 0.00% <ø> (ø) |
|
src/session.ts | 100.00% <100.00%> (ø) |
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
With Next 13, you can no longer rely on req and res being available if you're making a server component in the experimental app directory. To support this, I changed the
session
function to return an object with 2 functions instead of just a function.getSession
is the function that it originally returned which accepts the request and response objects. The other,getSessionFromCookies
, is made with Next 13's cookies function in mind. I expect the nextgetSessionFromCookies
function to be used in a similar way in server components:It should be noted that the session retrieved this way will be "readonly" in the sense that changes to it cannot be committed to the store.