Auth System - Cookie problem
Hey, I have another question. I'm currently trying to convert my AuthSystem from Next 14 to Next15.
the cookie set works
but the cookie get does not work with uploadthing in the middleware or in the trpc context
8 Replies
where are you setting the cookie
on my api route,
or give it a better way with trpc?
https://github.com/pingdotgg/uploadthing/blob/main/playground/lib/actions.ts#L15-L32
we call this from server action but this works
you should be able to set cookies from route handlers too
okay ty. i try it
as long as you're not streamign that orute handler
how do you mean?
http doesn't support setting headers after response has been sent
https://nextjs.org/docs/app/api-reference/functions/cookies#good-to-know
Okay that means I can´t do login route with trpc. because I can't set a cookie because it's not a serveraction or route handler.
As I understand it, I can only do it via API route because this is executed directly on the server side and not with trpc.
sorry i always need a little longer to understand things
?
fixed
sameSite "lax" was the solution
@julius ty