-
Notifications
You must be signed in to change notification settings - Fork 217
Open
Description
Hello Sir, I encountered problem while following your tutorial.
Your Code for userefreshtoken.js
const refresh= async()=>{
const response= await axios.get("/auth/refresh-token",{
withCredentials:true
});
As I am using post request for acessing /auth/refresh-token endpoint in my backend. so I changed it from get to post request.
Than I have to send the json body also but i don't know how can i send refreshtoken to my request.
Backend request :
POST /auth/refresh-token HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Content-Length: 225
{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2NDg1NTM0NDIsImV4cCI6MTY4MDExMTA0MiwiYXVkIjoiNjIwYzAyYTNlN2MyMWM0NzNhMjZmNGUxIiwiaXNzIjoic29jaWFsLmNvbSJ9.iQiSGutds1ZPrwrJi2lx0UOGUB4Ed6OQdUQAskq3BR0"
}
my code for userefreshtoken.js:
but I dont know where is refresh token stored in frontend to send it to this request
const refresh= async()=>{
const response= await axios.post("/auth/refresh-token",{
headers:{'Content-Type': 'application/json'},
withCredentials:true
});
As I haven't given refresh token I am getting 400 bad request error. Please help me!!

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels