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

Kratos middleware for NextJS + AppDir #52

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

KadoBOT
Copy link

@KadoBOT KadoBOT commented May 21, 2023

The newest version of Next.JS (app dir), introduced some changes which made the previous version of the ory next-integration not to work.

This is my own take on the already existing integration, to make it work with the newest next.js version.

The newest version of Next.JS (app dir), introduced some changes which made the previous version of the ory next-integration not to work.

This is my own take on the already existing integration, to make it work with the newest next.js version.
@KadoBOT
Copy link
Author

KadoBOT commented May 21, 2023

This needs to be improved, but I wanted to leave this here for further feedback.

TODOs:

  • extract the if from the middleware block, so ory-kratos middleware can be use with other middlewares

@aeneasr
Copy link
Member

aeneasr commented May 25, 2023

Cool! We definitely want to support the next version of NextJS

@KadoBOT
Copy link
Author

KadoBOT commented May 28, 2023

@aeneasr I updated the code with the latest version I've been using on my personal project. The nextjs version I'm using is the 13.4.4.

Please let me know if you want me to refine this PR, so you can actually use it. Or if I leave it here as reference, so you can implement this yourself later is enough.

Besides that, I also tweaked the code of the Kratos nextjs template as well, so some APIs are called on the server instead of the client (useEffect). Please let me know if that's something that interest you, an I can create a PR like this one in the other repo.

Cheers

@pvandamme
Copy link

Hi there, any updates on these ? :)

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.

None yet

3 participants