Skip to content

Q-org/next-auth-example-sign-in-page

 
 

Repository files navigation

🔐 Example Sign-in Page

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!

📺 Screenshot

Screenshot 1

🚀 Getting Started

  1. Install dependencies
$ npm Install
  1. Start dev server
$ npm run dev
# or
$ yarn dev
  1. Create a new .env file and fill in the variables:
  • To get GITHUB_ID and GITHUB_SECRET, navigate to GitHub > Settings > Apps and create a new app. Don't forget to add the callback URL http://<YOUR WEBSITE>/api/auth/callback/github.
  • To get NEXTAUTH_SECRET, use a a generator.
  1. Open http://localhost:3000 with your browser to see the result.

🛡 NextAuth.js

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.

📝 License

MIT

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 52.3%
  • CSS 47.7%