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

nextjs: implement SSR functions to retrieve user and access token info #10

Merged
merged 3 commits into from
Jun 4, 2024

Conversation

frankie567
Copy link
Member

@frankie567 frankie567 commented Nov 22, 2023

Following discussions in #8, those new functions should allow to retrieve user state information on the server-side; which will prove especially useful for SSR and App Router.

Most of the underlying mechanism was already in place with the middleware setting request headers.

Things yet to solve:

  • User cache information for Edge runtime. This is required so we can set the full user information. We need to be careful of the Next.js behavior of automatically caching fetch requests
  • Provide a way to pre-populate the React FiefAuthProvider, so client components can start with a pre-existing state coming from the server

Copy link

codecov bot commented Nov 22, 2023

Codecov Report

Attention: Patch coverage is 53.65854% with 19 lines in your changes missing coverage. Please review.

Project coverage is 86.26%. Comparing base (94d515b) to head (2977b29).

Files Patch % Lines
src/nextjs/index.ts 13.63% 19 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #10      +/-   ##
==========================================
- Coverage   88.84%   86.26%   -2.58%     
==========================================
  Files          10       10              
  Lines         529      568      +39     
  Branches      128      151      +23     
==========================================
+ Hits          470      490      +20     
- Misses         59       78      +19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@frankie567 frankie567 marked this pull request as ready for review June 4, 2024 06:32
@frankie567 frankie567 merged commit fa72922 into main Jun 4, 2024
6 of 8 checks passed
@frankie567 frankie567 deleted the nextjs/ssr branch June 4, 2024 06:41
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.

1 participant