Open ducyb782001 opened 6 months ago
i have similar problem
i have similar problem
Do you resolved this problem? I move the header of client interceptors to global of this file and it will resolved
client.interceptors.request.use(
(request) => {
const cookies = cookie.parse(window?.document.cookie)
const acceptLanguage = localStorage.getItem("i18nextLng")
if (cookies.accessToken) {
request.headers["Authorization"] = `Bearer ${cookies.accessToken}`
}
if (acceptLanguage) {
request.headers["Accept-Language"] = acceptLanguage
}
return request
},
(error) => {
return Promise.reject(error)
},
)
You can try it
i have similar problem
Do you resolved this problem? I move the header of client interceptors to global of this file and it will resolved
client.interceptors.request.use( (request) => { const cookies = cookie.parse(window?.document.cookie) const acceptLanguage = localStorage.getItem("i18nextLng") if (cookies.accessToken) { request.headers["Authorization"] = `Bearer ${cookies.accessToken}` } if (acceptLanguage) { request.headers["Accept-Language"] = acceptLanguage } return request }, (error) => { return Promise.reject(error) }, )
You can try it
i added a flag to stop looping
Hi every one, i have api.ts file like that
I add some log and i realize after one request get 401 error. It will call refresh api immediately => get new accessToken and then call api again. But new api don't have accessToken. It quite strang, any one can help me?
My version is: