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
Add next.js auth helpers for server components #380
Conversation
1c22f12
to
f8df3cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks.
.changeset/purple-tomatoes-shout.md
Outdated
'@supabase/auth-helpers-nextjs': patch | ||
--- | ||
|
||
Add helper for Next.js Server Components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add helper for Next.js Server Components | |
feat: add helper for Next.js Server Components. |
Awesome work @dijonmusters I like the I wanted to ask, how can I access this session from the child components without having to await it? Thanks so much. |
What kind of change does this PR introduce?
Add an additional auth helper function for
createServerComponentSupabaseClient
. This, paired with a middleware function to refresh the Supabase session, make it possible to use an authenticated Supabase client in a Next.js 13 Server Component - theapp
directory.The
app
directory is still in beta so is likely to change. This should be seen as an experimental approach to start trying out Server Components with Supabase.What is the current behavior?
There is no supported way to create an authenticated Supabase client in a server component
#341
What is the new behavior?
We have an experimental way to create an authenticated Supabase client in a server component