ApiV2-GraphQL-Docs icon indicating copy to clipboard operation
ApiV2-GraphQL-Docs copied to clipboard

Can't authenticate

Open marceloclp opened this issue 6 years ago • 0 comments

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: img

What am I doing wrong?

marceloclp avatar Jan 22 '19 11:01 marceloclp