User Authentication CORS error

18 views
Skip to first unread message

Luke Riches

unread,
Jun 10, 2024, 9:13:47 PM (12 days ago) Jun 10
to Eventbrite Developers
Hi!

I'm currently trying to set up User Authentication and when sending a request to get the users API key I'm receiving a CORS error "blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.". I'm able to make the request through insomnia but when trying to integrate it into my react app through axios I am met with the error.

Below is my code, I hope someone is able to help.

Thanks,
Luke

var options = {
method: "POST",
headers: {
"content-type": "application/x-www-form-urlencoded",
},
data: {
grant_type: "authorization_code",
client_id: //Removed ,
client_secret: //Removed,
code: eventbriteAccessCode,
redirect_uri: "http://localhost:5173/",
},
};

if (
user !== undefined &&
eventbriteAccessCode !== null &&
eventbriteApiKey === undefined
) {
axios
.request(options)
.then((response) => {
console.log(response);
})
.catch((err) => {
console.log(err);
});
}



Reply all
Reply to author
Forward
0 new messages