Closed vdvpie22 closed 2 years ago
When i use this construction:
fastify.register(require('fastify-axios'), { clients: { v1: { baseURL: 'https://v1.api.com', headers: { 'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJxyz' } }, })
how i can update headers before i send new request?
Hi @vdvpie22 , you can use the transformRequest config to check if token is expired and update the headers. Let's take a look the axios documentation [https://axios-http.com/docs/req_config](axios documentation)
transformRequest
When i use this construction:
how i can update headers before i send new request?