I am using Edmodo as a login service to my app. When users log out of my app, I’d like it to log them out of their Edmodo accounts as well. According to Edmodo’s docs, I can use https://api.edmodo.com/logout?return_to=http://yourSite.com
to log them out of Edmodo.
So I’ve tried the below code and get the error
XMLHttpRequest cannot load https://api.edmodo.com/logout?return_to=http%3A%2F%2Flocalhost%3A3000%2F. The request was redirected to 'http://localhost:3000/', which is disallowed for cross-origin requests that require preflight
HTTP.get(endpoint, {
params: {return_to: 'http://localhost:3000/'},
headers: {Authorization: 'Bearer ' + edmodoToken},
}, function (error, response) {
if (error) {
console.log(error);
}
console.log(response);
});
I have also tried it without the params but that gives me
XMLHttpRequest cannot load https://api.edmodo.com/logout. The request was redirected to 'https://api.edmodo.com/login', which is disallowed for cross-origin requests that require preflight.
And based on some initial CORS research, I tried, with and without the params, adding the headers 'Access-Control-Allow-Origin': '*',
and 'Access-Control-Allow-Headers': '*',
but the errors remained.
Any ideas?