Auth implimentation using Next.js 14 and Auth.js.
I made this simple auth implementation to recycle and reuse and use for my other projects.
📝 This version only offers only for email and password sign in. I plan to add on to this very soon.
- Authentication
- Auth.js
- Working with Next.js middleware
Clone the repository
git clone https://github.com/sidsurakanti/auth.git
Navigate to the project directory
cd auth
Install dependencies
npm install
Add .env.local
file using .env.example
# auth secret for next auth
# you can generate one by running this in your terminal: $ openssl rand -base64 32
AUTH_SECRET=
# vercel postgres env variables
POSTGRES_URL=
POSTGRES_PRISMA_URL=
POSTGRES_URL_NO_SSL=
POSTGRES_URL_NON_POOLING=
POSTGRES_USER=
POSTGRES_HOST=
POSTGRES_PASSWORD=
POSTGRES_DATABASE=
Start the dev server
npm run dev
Your application should now be running on http://localhost:3000
.
- Have a look through the code and use the parts you need
- That's it