Repository navigation
0.1.0-alpha.8: server sessions in Effect and fetch, rewritten JSDoc - #9
Merged
Merged
Conversation
- Document forRequest in the server sessions guide and README - Keep a request view's version stable through refreshes and without a secret - Run the mirror type test with exactOptionalPropertyTypes off
- Fix the early refresh timing, nextJar's caching and createServerAuth's options - Clarify signOut, renew and read-only jar behaviour in the Effect docs - Wrap long JSDoc example lines
- Declare AuthFetch as createAuthFetch's return type, with JSDoc and an example - Add type tests for typing props and test fakes with it
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.
Summary
Release
0.1.0-alpha.8. App code written against a client (createAuthFetch,Auth.layer, effetch'ssessionBearer) now runs on the server against one request's cookie session. The JSDoc on every entry point is rewritten for app developers.Added
serverAuth.forRequest(jar)(/server) returnsRequestAuth, one request's session with a client's read side:getSession,signOut,credentials,isCurrentandstate. With it,createAuthFetchsends the cookie's token and saves a renewed one after a 401.REFRESH_FAILED, unless the same request's writable jar already renewed the token.Auth.layer(/effect) also accepts aRequestAuth.Auth.session,Auth.credentials,Auth.renew,Auth.signOutandsessionBearerthen work in server functions, actions and route handlers.Auth.signInandAuth.updateUserdie on the server. CallserverAuth.signIn(jar, …)andserverAuth.updateUser(jar, …)instead.AuthFetch(/http) is the typecreateAuthFetchreturns. Use it to type props, contexts and test fakes.serverAuth, and queries.Fixed
stateatinitializing. It is nowunavailable, with the session ID.versionstays the same through refreshes, and its state is stable when there is no secret.Changed
nextJarreturnscreateServerAuthacceptsclient.post) instead of binding an endpoint on every call.