GitHub Strategy
π¨βπΌ Let's put the "Login with GitHub" button
on . Kellie π§ββοΈ made a
ProviderConnectionForm
for this. Feel free to take a look at it if you like.
It's in . It's just a form that
POSTs to /auth/github
.Speaking of
/auth/github
, next you'll go there to handle the action
when
that form is submitted. It doesn't do much (remix-auth
's authenticator
you
made earlier will do the work of sending the user to GitHub to authenticate).
Kody π¨ will be waiting for you
in .Once you've finished with that, clicking the button should send you to GitHub.
If you set up a real OAuth app on GitHub then you should see a page asking you
to authenticate with your own app. Otherwise you'll get an error page.
Once you authenticate with GitHub, it'll send you back to the redirect callback
URL you configured (which should be set to
http://localhost:4000/auth/github/callback
). So
in you can use
the remix-auth
authenticator
to take the code
and state
from the URL
search params and exchange those for an access token which it can use to make
requests to the GitHub API to get the user's profile data. Kody π¨ will help you
there too.