-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Clerk or any other auth provider support - middleware support #1325
Comments
auth is still a space to explore. #576 is an old issue. |
I might try and implement a middleware.ts |
If there is an official lib for clerk it will be on their website which is highly popular (people will be like what's this and check waku out)so after I try and add middleware I will send clerk a Pr |
I'm not sure if you checked this, but just in case:
Be warned that we plan to merge #1281 soon. So, you'd better wait for it before sending a pr. |
Thanks, what does this allow the user to do. Is it similar to like a nextresponse kind of thing? |
Probably. Check out the Middleware type. It returns a Handler. waku/packages/waku/src/lib/middleware/types.ts Lines 36 to 39 in 48b48d4
|
React Router v7 is probably a better example to use than NextJS. https://clerk.com/docs/references/react-router/read-session-data#server-side Waku doesn't have built-in loader functions like React Router. We can just call a function to create the clerk client from a server component or from middleware. It's possible to implement auth in server components and server functions without Waku middleware by using the Hono context. Roughly like this -
And then call React does concurrent rendering of pages and layouts when you are using Suspense so that's why I set the promise into the context so |
That's great thanks I will try a full implementation later |
Is this a question to ask clerk or here. I just would like to create full stack apps with waku
I think waku needs middleware support than I can send clerk a PR that adds a waku package that is basically the next version but a few tweaks and disable app router (and have to ability to add back if waku gets support for it )
Thanks for such a brilliant project
The text was updated successfully, but these errors were encountered: