0

I am using NextAuth and Github to authenticate a user in my app. I am trying to run a TRPC query to return an authenticated user's github repo information.

const response = await fetch(`https://api.github.com/user`, {
      headers: {'Authorization': `Bearer ${account?.access_token}`,}
    });
  1. The access_token is available - it logs out
  2. The access_token is provided by NextAuth
  3. Error Message: documentation_url: "https://docs.github.com/rest" message: "Bad credentials"

I am not sure exactly what I am doing wrong. When the user authenticates into my APP, I make sure to use user scope - and this is reflected under the account.scope property and Github Authentication UI.

I would appreciate some help, thank you !

Ken White
  • 123,280
  • 14
  • 225
  • 444
ETHan
  • 187
  • 1
  • 4
  • 17

0 Answers0