Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add getServerSession and SessionProvider #309

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonas-jonas
Copy link
Member

@jonas-jonas jonas-jonas commented Dec 9, 2024

BREAKING CHANGES: This patch changes the underlying mechanism of the `useSession` hook. It now requires a `<SessionProvider>` in the tree above its usage.

You can now provide a session object to the initial store of the `SessionProvider` making it possible to fetch the session on the server.

If you use the `<Settings />` component, and make use of the integrated user menu, you must now wrap the whole component in the `SessionProvider`.

Related Issue or Design Document

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

@jonas-jonas jonas-jonas self-assigned this Dec 9, 2024
@jonas-jonas jonas-jonas force-pushed the jonas-jonas/sessionImprovements branch from 55ba82c to 978c9e5 Compare December 10, 2024 16:41
@jonas-jonas jonas-jonas changed the title feat: add getServerSession and SessionProvider feat!: add getServerSession and SessionProvider Dec 10, 2024
@jonas-jonas jonas-jonas force-pushed the jonas-jonas/sessionImprovements branch from 978c9e5 to 039cc74 Compare December 11, 2024 08:56
@jonas-jonas jonas-jonas requested a review from mszekiel December 11, 2024 08:56
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

Attention: Patch coverage is 55.95238% with 37 lines in your changes missing coverage. Please review.

Project coverage is 44.05%. Comparing base (df98c2b) to head (f0e2bac).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #309      +/-   ##
==========================================
- Coverage   44.25%   44.05%   -0.20%     
==========================================
  Files         127      131       +4     
  Lines        1837     1893      +56     
  Branches      265      276      +11     
==========================================
+ Hits          813      834      +21     
- Misses       1016     1053      +37     
+ Partials        8        6       -2     
Components Coverage Δ
@ory/elements-react 38.07% <47.45%> (-0.61%) ⬇️
@ory/nextjs 70.05% <76.00%> (+0.35%) ⬆️

@jonas-jonas jonas-jonas force-pushed the jonas-jonas/sessionImprovements branch from 039cc74 to 703a72e Compare December 11, 2024 09:29
@jonas-jonas jonas-jonas force-pushed the jonas-jonas/sessionImprovements branch from 703a72e to f0e2bac Compare December 11, 2024 09:31
@jonas-jonas jonas-jonas requested a review from aeneasr December 11, 2024 09:46
Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me on the conceptual level. Did not check the code itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants