tRPCttRPC
Powered by
TkDodo 🔮T
tRPC•4y ago•
5 replies
TkDodo 🔮

clear cookie onError

I'd like to clear a cookie (in nextjs) when a 403 error happens. I've been looking at the global error handling: https://trpc.io/docs/error-handling#handling-errors

and this looks like the right place, except that I don't have access to the
response
response
, which would be needed to clear a cookie. Is there a better place to do this, or is there a reason there is no access to the
res
res
?
Error Handling | tRPC
Whenever an error occurs in a procedure, tRPC responds to the client with an object that includes an "error" property. This property contains all the information that you need to handle the error in the client.
Error Handling | tRPC
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

tRPC onError
JoeJJoe / ❓-help
3y ago
onError callback type
MugetsuMMugetsu / ❓-help
2y ago
onSuccess and onError in one time
SzymonSSzymon / ❓-help
15mo ago
Cookie authentication flow
sevenSseven / ❓-help
2y ago