79231454

Date: 2024-11-27 18:24:35
Score: 0.5
Natty:
Report link

The code provided here -

const instance = axios.create({
    baseURL: process.env.URL,
    headers : {
        'Authorization': `Bearer ${token}`
    }
})

will run only once You need to use interceptors to retrieve and pass the token for each network request. Reference: https://axios-http.com/docs/interceptors

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Kunal Agrawal