This is a custom NextAuth.js sign-in page I'd once used in an internal application.
I decided to open-source it in this example repository. Feel free to use as you see fit!
- Install dependencies
$ npm Install
- Start dev server
$ npm run dev
# or
$ yarn dev
- Create a new
.env
file and fill in the variables:
- To get
GITHUB_ID
andGITHUB_SECRET
, navigate to GitHub > Settings > Apps and create a new app. Don't forget to add the callback URLhttp://<YOUR WEBSITE>/api/auth/callback/github
. - To get
NEXTAUTH_SECRET
, use a a generator.
- Open http://localhost:3000 with your browser to see the result.
You will find the example sign-in page under /src/pages/auth/signin.js
.
This has an example OAuth provider (Github
) and an example magic link Email login field, although the Email provider is not setup in this repo. For email setup, please check out the docs for more information.
MIT