unhardcode base url (i think closes #3?)

This commit is contained in:
oat 2020-10-12 05:02:45 +03:00
parent 36f4da4a28
commit e218255441
Signed by: oat
GPG key ID: DD83A9617A252385

View file

@ -59,7 +59,8 @@ export function run(app) {
res.send(`whoooops<br>${err}`);
}
} else {
res.send(`<a href="https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_OAUTH_CLIENTID}&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fdiscordauth&response_type=code&scope=identify">Click here!!</a>`);
const url = `http://${req.headers.host}/discordauth`;
res.send(`<a href="https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_OAUTH_CLIENTID}&redirect_uri=${encodeURI(url)}&response_type=code&scope=identify">Click here!!</a>`);
}
});
}