How to set "credentials: true" in client side using rpc?
I'm using rpc with react query on the client side, this kind of fetching has already credentials: true?
12 Replies
It's not sending the cookie to my client side
Are they running on different ports?
There’s browser extensions like allow cors that will let you set it on different ports
yes, actually I already set the cors with origin: localhost:3000 for my client also set the credentials to true
Can you text and postman and see if it’s coming through
here's my client
I always had wired issues when working on different ports
on the postman there's no problem at all when I request my login to send the cookie and then I request to my user route that there's verify my cookie it's okay there's no problem
and I forgot to mention when I'm using fetch api it's sending the cookie to my client, but when I use the react query with rpc I can only see the cookie from network on the chrome dev tool but in the application tab I can't see the cookie
GitHub
Setting a cookie using (rpc + react query) · honojs · Discussion #2...
I'm sending a request to my login api endpoint from to client using react query and rpc but I'm not getting the cookie from my application tab in chrome dev tools but on the network tab the...
when I'm using standard fetch api with
credentials: 'include'
option, there's no problem at all I got the cookie from server to client, but when using rpc
I can't get the cookie from server to clientI already fixed, by adding this fetch option, why this option is not included on the docs? I mean there's fetch option in the docs but the example is only for using env