https://github.com/fredlackey/custom-nextauth-backend
Quick demo of how to use a custom backend with NextAuth.js while implementing a two-stage login approach.
https://github.com/fredlackey/custom-nextauth-backend
Last synced: 2 months ago
JSON representation
Quick demo of how to use a custom backend with NextAuth.js while implementing a two-stage login approach.
- Host: GitHub
- URL: https://github.com/fredlackey/custom-nextauth-backend
- Owner: FredLackey
- License: apache-2.0
- Created: 2023-08-16T16:41:49.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-16T17:12:35.000Z (almost 2 years ago)
- Last Synced: 2025-01-24T10:30:36.703Z (4 months ago)
- Language: JavaScript
- Size: 219 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# custom-nextauth-backend
Quick demo of how to use a custom backend with NextAuth.js while implementing a two-stage login approach.
## Background
Out of the box, NextAuth is tighly coupled to its database providers. Sequences such as the Passwordless login use data structures which are both opinionated and limited. This project demonstrates how to use a custom backend API to implement a two-stage login process.
The first stage is meant to _request_ a login and have a code sent to the user's email address or mobile number. They are then redirected to a form which uses the `authorize` function within the Credentials Provider to send the same address to the back end but, this time, with a one-time-use confirmation code.
## Technologies
### Back-End (Private API)
* [Fastify](https://fastify.dev/)
* [MongoDB Atlas](https://www.mongodb.com/atlas)
* [NodeJS](https://nodejs.org/)
* [Prisma.IO](https://www.prisma.io/)### Front-End (Public App & API)
* [NextJS v13](https://nextjs.org/)
* [NextAuth](https://next-auth.js.org/)
* [React / ReactJS](https://react.dev/)
* [Tailwind CSS](https://tailwindcss.com/)## Contact Info
**Fred Lackey**
[[email protected]](mailto:[email protected])
[http://fredlackey.com](http://fredlackey.com)