Safer Basic Auth

This commit is contained in:
Daniel Odendahl Jr
2018-02-26 23:19:42 +00:00
parent 53eb402472
commit 59a5c873c2
4 changed files with 9 additions and 7 deletions
+2 -1
View File
@@ -33,7 +33,8 @@ module.exports = class GitHubCommand extends Command {
async run(msg, { author, repository }) {
try {
const { body } = await snekfetch
.get(`https://${GITHUB_USERNAME}:${GITHUB_PASSWORD}@api.github.com/repos/${author}/${repository}`);
.get(`https://api.github.com/repos/${author}/${repository}`)
.set({ Authorization: `Basic ${Buffer.from(`${GITHUB_USERNAME}:${GITHUB_PASSWORD}`).toString('base64')}` });
const embed = new MessageEmbed()
.setColor(0xFFFFFF)
.setAuthor('GitHub', 'https://i.imgur.com/e4HunUm.png', 'https://github.com/')