April 26, 2021
Steps I completed
- Added first step of authenticating with Github
- Using OAuth
- Created an org within Github called Get Git Me for this project
- Created 2 different apps, 1 for testing on localhost, another for production
- From there, you get a public key and a private key.
- We've built the first page, where users sign in with their Github account
- After signing in, they'll see the "scopes" that we're requesting
- After agreeing to those scopes, they'll be sent back to our webpage at our callback path.
- This is where we need to send another POST request to get Access Tokens. This should be done on server (I will use AWS API Gateway / Lambda for this in the next episode)
Things I learned
- Passing query parameters down within an HTML form
<input type="hidden />
- If you just put it into the string, the HTML
<form>
tag will strip out the query parameters
- Extracting query parameters from route using
useLocation().search
from react-router
and URLSearchParams
Follow up to livestream
In my live stream, I didn't know how to revoke my access to the Get Git Me localhost Github app. I found out how.
Go to https://github.com/settings/applications (you'll need to be signed in). Here's a list of all OAuth apps that you gave permission to use your Github accounts. You can revoke access for each application here.