Replies: 1 comment 1 reply
-
In Waku, cookies can be set even with server components through the middleware as long as the HTTP headers are not sent yet. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Congrats on the release of server actions! I'm trying them out because they could genuinely solve key challenges right now trying to implement auth with Waku.
My question is simply whether we can set cookies within a server action function.
But for further context, feel free to keep reading. I've tried to provide some value by summarising my current understanding of modern best practices for PKCE (server-side) auth flows in React frameworks.
res.headers['set-cookie'] = ...
)Because I can't replicate this pattern in Waku, I'm forced into a hacky workaround involving multiple redirects (with auth data transferred using query params) and then using custom middleware to perform auth logic. This has its own set of problems and isn't a robust solution.
But if we can set cookies in server actions, all our auth woes could be solved forever 😁
Sounds like we're close so I'm super excited - nice work again
Beta Was this translation helpful? Give feedback.
All reactions