ApiV2-GraphQL-Docs
ApiV2-GraphQL-Docs copied to clipboard
Can't authenticate
Well, I have been at it for a whole day now... I guess it's time to put my shame aside and create a thread. I can't do the first authentication step (get the token).
<a href='https://anilist.co/api/v2/oauth/authorize?client_id=****&redirect_uri=localhost:3031/auth&response_type=code'>Login with AniList</a>
My server that's supposed to get the token.
const express = require("express");
const path = require("path");
const server = express();
server.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, DNT, Upgrade-Insecure-Requests");
next();
});
server.get('/', (req, res) => {
res.sendFile(path.join(__dirname, "index.html"));
});
server.get('/auth', (req, res) => {
console.log(res);
});
server.listen(3031);
console.log("server listening on localhost:3031");
I get two requests, one 302 and a cancelled:

What am I doing wrong?