ndom91 / next-auth-example-sign-in-page

Example Auth.js v5 Custom Signin Page

Home Page:https://authjs-custom-page-example.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ” 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

About

Example Auth.js v5 Custom Signin Page

https://authjs-custom-page-example.vercel.app

License:MIT License


Languages

Language:TypeScript 91.9%Language:CSS 6.6%Language:JavaScript 1.5%