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

[EXPERIMENTAL] Next.js 13 app directory example #342

Closed
wants to merge 2 commits into from

Conversation

thorwebdev
Copy link
Member

No description provided.

// // Allow supabase-js on the client to read the cookie as well
// httpOnly: false
// });
// context.res.setHeader('set-cookie', [...newSetCookies, newSessionStr]);

Choose a reason for hiding this comment

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

out of curiosity, cookie().set() doesn't work in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

These are read-only functions: https://beta.nextjs.org/docs/upgrade-guide#accessing-request-object

But we're able to modify the res via middleware, see discussion here: #341 (comment)

// NOTE: This is experimental and used as research to understand how to support Next.js 13 in the future.
// https://beta.nextjs.org/docs/data-fetching/fetching#example-fetch-and-use-in-client-components

import { use } from 'react';
Copy link

@imbhargav5 imbhargav5 Oct 27, 2022

Choose a reason for hiding this comment

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

🤔 Will this be a client component without use client?

Edit: This is probably still in draft and you are probably working on it. Just thought this might have been missed.

@thorwebdev thorwebdev changed the title [EXPERIMENTAL] Next.js 13 example [EXPERIMENTAL] Next.js 13 app directory example Nov 3, 2022
@thorwebdev thorwebdev linked an issue Nov 4, 2022 that may be closed by this pull request
@cdedreuille
Copy link

It would be great to keep the old example with the pages folder as it will probably stay for a while until the full transition to app is done.

@thorwebdev
Copy link
Member Author

With version v0.5.2 we've added a createServerComponentSupabaseClient which can be used server components to get an authenticated Supabase client. This is the PR which includes an example. Note that this needs to be used in combination with middleware as Next.js does not yet allow setting headers in server components.

@thorwebdev thorwebdev closed this Nov 15, 2022
@thorwebdev thorwebdev deleted the thor/nextjs-13-example branch November 15, 2022 06:30
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.

Next.js 13 app directory support Next 13 example (app/ Directory)
4 participants