learning-graphql icon indicating copy to clipboard operation
learning-graphql copied to clipboard

GitHub authentication is completely broken

Open jaubin opened this issue 5 years ago • 2 comments

The authentication URL does not work anymore once you've got your Token.

It is no more : https://api.github.com/user?access_token=[token]

But : https://api.github.com/user with the token in the 'Authorization' header. The problem is that I could never make this work even following this documentation :

https://docs.github.com/en/developers/apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github

Could you please fix the code on the repo since it renders basically chapters 5, 6 and 7 useless ?

jaubin avatar Mar 12 '21 20:03 jaubin

I have the exact same issue as @jaubin describe. Please fix the code in this block under lib.js const requestGithubUserAccount = (token) => { }

narumolp avatar Apr 04 '21 05:04 narumolp

I have the exact same issue as @jaubin describe. Please fix the code in this block under lib.js const requestGithubUserAccount = (token) => { }

Must specify access token via Authorization header:

const requestGithubUserAccount = token => 
    fetch(`https://api.github.com/user`, {
        headers: {
            Authorization: `token ${token}`
        },
    }).then(res => res.json())

L1ghtBringer avatar May 28 '21 12:05 L1ghtBringer