A simple demo on how to do GitHub OAuth with Next.js and NextAuth.js.
git clone https://github.com/luckyyang/nextjs-oauth-demo-with-github.git
cd nextjs-oauth-demo-with-github
yarn
Copy the .env.local.example file in this directory to .env.local (which will be ignored by Git):
cp .env.local.example .env.local
Refer to this doc to create personal access token, then put it to .env.local
Refer to this blog to get github Client ID and Client Secret, then put them to .env.local
, ignore this if you do not need github oauth.
yarn dev