Skip to content

Simple Example on how to use Next-Auth with Google Provider & Nodemailer provider with Magic links

Notifications You must be signed in to change notification settings

galsever/next-auth-simple-ex

Repository files navigation

This is a simple example of how to use Next-Auth v5

To use it:

  1. git clone https://github.com/galsever/next-auth-simple-ex.git
  2. cp .env.example .env.local
  3. Set the env vars
  4. 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

About

Simple Example on how to use Next-Auth with Google Provider & Nodemailer provider with Magic links

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published