Quote:
const config = {
headers: {
'Authorization': `Bearer ${localStorage.getItem('token')}`,
"Access-Control-Allow-Origin" : "",
"Allow": "GET",
"Content-type": "Application/json",
}
};
There is absolutely no point in setting the
Access-Control-Allow-Origin
and
Allow
headers on your request. These headers must be sent as part of the
response by the remote server.
Cross-Origin Resource Sharing (CORS) - HTTP | MDN[
^]
The error message clearly tells you that it is the
request header which is the problem:
Quote:
Request header field access-control-allow-origin is not allowed