Deployed react app on Netlify, How/What forrmat to send axios request to backend on Heroku after login?

Viewed 11

I have deployed Backend on Heroku & frontend on Netlify. After sending login request from frontend, I am getting a token, which I'm setting using React-cookie from frontend, so token(cookie) is accessible to me. But, when I goto dashboard, their I have to make authorized request to backend, which I'm not able to do so far. How can I make Requests from frontend and what format should I make requests ? I have given netlify site url to backend when I'm using cors. But, whenever I'm making request from frontend, It is giving me 401 error, saying that unauthorized access, I think i have to pass cookies from frontend as well, how can i send it in headers ?

0 Answers
Related