This is a Next.js project bootstrapped with create-next-app
.
Clone code:
git clone https://github.com/BLOCKCHAINDEVWEB/nextjs-auth2.git
cd nextjs-auth2
Duplicate the .env file given as an example:
cp .env.sample .env
- Open your Github settings and click Developer settings.
- Click OAuth Apps and create your New OAuth App.
- Completed the following and Register application.
sample:
- Application name: nextjs-oauth
- Homepage URL: http://localhost:3000/home
- Authorization callback URL: http://localhost:3000/api/auth/callback/github
- Generate a new client secret and Update application.
- Complete your .env file with variables environnement keys of project:
AUTH_SECRET=secret
JWT_SECRET=secret
GITHUB_CLIENT_ID=1a29...bea
GITHUB_CLIENT_SECRET=17e69d3543b673d...7d
execute commands:
yarn or npm install
npm run dev
Open browser at http://localhost:3000
Authorizing Github OAuth Apps