You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm leaving this here in case others have the same problem. Simply updating the package does not solve the problem since any cookies set incorrectly on the /trpc path rather than the root (or on other paths) are preserved. My solution to clean up the broken cookies was, in hooks.server.ts:
constremoveTrpcCookies: Handle=async({ event, resolve })=>{// filter out any cookies set on the '/trpc' path - fixes an issue where// trpc-sveltekit was incorrectly proxying cookies without preserving options// and therefore setting outdated auth cookies on the '/trpc' path.// Once all clients have had this cookie removed, this handler can be removed as well.if(!event.url.pathname.startsWith("/trpc")){conststorageKey=<yourcookienamehere>event.cookies.delete(storageKey,{path: "/trpc"});}returnresolve(event);};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This was fixed in ff7e57d
I'm leaving this here in case others have the same problem. Simply updating the package does not solve the problem since any cookies set incorrectly on the
/trpc
path rather than the root (or on other paths) are preserved. My solution to clean up the broken cookies was, inhooks.server.ts
:Beta Was this translation helpful? Give feedback.
All reactions