Supabase offers a number of authentication options out of the box. In this video, we look at implementing third party auth using GitHub as a provider.
In order to do this, we need to register a new OAuth application in GitHub, and configure it to communicate with our Supabase project. Supabase automatically handles receiving tokens at the /auth/v1/callback
endpoint.
Additionally, we implement /login
and /logout
pages to handle authentication in our Next.js application. We can use the supabase-js
library to detect whether or not a user is signed in using the supabase.auth.user()
function.
BTW, you may need to restart your Next.js dev server whenever you add new variables to .env.local.
Excellent call out! Thanks! 🙌