diff --git a/js/auth.js b/js/auth.js index 493adac..57a67fd 100644 --- a/js/auth.js +++ b/js/auth.js @@ -6,10 +6,18 @@ if(typeof authCode !== undefined) { headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ authCode }) + body: JSON.stringify({ authCode: authCode }) }) - .then(res => res.text()) + .then(res => res.json()) .then(res => { - console.log(res) + fetch('https://discord.com/api/v10/users/@me', { + headers: { + 'Authorization': `Bearer ${res.access_token}` + } + }) + .then(res => res.json()) + .then(res => { + console.log(res) + }) }) } \ No newline at end of file