react-github-login icon indicating copy to clipboard operation
react-github-login copied to clipboard

'code' not found

Open joshuadiezmo opened this issue 8 years ago • 8 comments

Error: 'code' not found at t.r.onSuccess (GitHubLogin.js?ff85:1) at eval (GitHubLogin.js?ff85:1) at

joshuadiezmo avatar Oct 07 '17 16:10 joshuadiezmo

You should try setting redirectUri to an empty string :

<GitHubLogin 
    clientId="" 
    redirectUri="" 
    onSuccess={console.log} 
    onFailure={console.log}
/>

polc avatar Oct 12 '17 15:10 polc

@joshuadiezmo Can you provide a code sample of how you're instantiating the component? Thanks for the report!

kruppel avatar Oct 12 '17 20:10 kruppel

Just to let you know, the solution @polc gave worked. When you leave redirectUri out of the parameters, then you get that error message.

timesync avatar Dec 22 '17 00:12 timesync

Yeah I've got the code error: 99be1a4d4e66752d96e6.

Sunnyvo avatar Dec 27 '17 08:12 Sunnyvo

Oh man! u nailed it!.. thanks alot.. this error is bugging me the whole day.. thanks alot

SubashMourougayane avatar Feb 21 '18 14:02 SubashMourougayane

I have the following code:

        <GithubLogin
          clientId='1759a45458ed00e'
          redirectUri=''
          onSuccess={this.handleSuccess}
          onFailure={(err) => console.log('Error Logging in: ', err)}
        />

and still getting the above error!

danedavid avatar Apr 26 '18 08:04 danedavid

You have to put the same URL that it's configured in the OAuth callback field on your GitHub App

<GitHubLogin 
    clientId="" 
    redirectUri="http://localhost:3000/login" 
    onSuccess={console.log} 
    onFailure={console.log}
/>

GitHub App

Authorization callback URL
 http://localhost:3000/login

joelgtsantos avatar Aug 08 '18 16:08 joelgtsantos

<GitHubLogin clientId="Github Client ID" redirectUri="" onSuccess={ responseGithub } onFailure={ responseGithub } />

vahe-nikoghosyan avatar Jun 03 '20 09:06 vahe-nikoghosyan