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
1 changed files with 2 additions and 1 deletions

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>`);
}
});
}