ShareCourse Outline

Build an App with React and Ampersand

3-1 Redirecting to GitHub for OAuth

next:Generating and validating state parameter
previous:Internal navigation

topics

modules installed

We installed version 2.4.1 of qs you can grab this exact version by doing:

npm i --save qs@2.4.1

copy/paste

GitHub redirect url including client_id that will work as long as you're running on localhost:3000:

window.location = 'https://github.com/login/oauth/authorize?' + qs.stringify({
  client_id: 'f8dd69187841cdd22a26',
  redirect_uri: window.location.origin + '/auth/callback',
  scope: 'user,repo'
})

notes


Code Viewer