diff --git a/frontend/src/providers/APIProvider/APIProvider.jsx b/frontend/src/providers/APIProvider/APIProvider.jsx index 66c4481..dad3117 100644 --- a/frontend/src/providers/APIProvider/APIProvider.jsx +++ b/frontend/src/providers/APIProvider/APIProvider.jsx @@ -125,8 +125,9 @@ export function APIProvider({children}) { } console.log(body) + const tokenStr = JSON.parse(localStorage.getItem('user'))['access'] await service.post(`${URL.baseURL}${URL.services.default}${endpoint}`, - body) + body, {headers: {"Authorization" : `Bearer ${tokenStr}`}}) .then(response => { setAddToCartResponse(response) })