This is a simple example of how to use Next-Auth v5
To use it:
git clone https://github.com/galsever/next-auth-simple-ex.git
- cp .env.example .env.local
- Set the env vars
- Then run:
bun i
bun dev
These files serve for authentication:
- auth.ts
- auth.config.ts
- middleware.ts
- prisma.ts
- prisma/schema.prisma
- api/auth/[...nextauth]/route.ts
localhost:3000 is accessible without a session, localhost:3000/dashboard is not
The Google & Nodemailer Provider are split on purpose, because otherwise next-auth doesn't work