🐛 fix(api.tsx): update Authorization header to use access_token from cookies instead of accessToken variable to fix authentication issue

This commit is contained in:
Cristhian Zanforlin Lousa 2023-09-21 11:50:01 -03:00
commit 610e94759a

View file

@ -40,7 +40,9 @@ function ApiInterceptor() {
try {
if (error?.config?.headers) {
delete error.config.headers["Authorization"];
error.config.headers["Authorization"] = `Bearer ${accessToken}`;
error.config.headers["Authorization"] = `Bearer ${cookies.get(
"access_token"
)}`;
const response = await axios.request(error.config);
return response;
}