API GitHub CORS, , , https://github.com/login/oauth/access_token OAuth CORS -.
- https://github.com/prose/gatekeeper:
Gatekeeper: OAuth GitHub.
- , , Github - OAuth .
. Gatekeeper, , , .
: , https://cors-anywhere.herokuapp.com/
var req = new XMLHttpRequest();
req.open('POST',
'https://cors-anywhere.herokuapp.com/https://github.com/login/oauth/access_token',
true);
req.setRequestHeader('Accept', 'application/json');
req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
req.send('code=' + encodeURIComponent(location.query.code) +
'&client_id=foo' +
'&client_secret=bar');
...
. Cors - CORS.