Skip to content

Next.js login simple example based on NextAuth.js

Notifications You must be signed in to change notification settings

kimfame/next-login

Repository files navigation

Next.js 14 - Login, Logout example using NextAuth.js

This is a Next.js project bootstrapped with create-next-app.

Create .env.local file

MONGODB_URI=
NEXTAUTH_URL=
NEXTAUTH_SECRET=

NEXTAUTH_SECRET Generator example

openssl rand -base64 32

Getting Started

Run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.