tsuki-lab / nextjs-with-nextauth

Adapted next-auth.js to Next.js.

Home Page:https://nextjs-with-nextauth-murex.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NextAuth.js and Next.js Example

This example shows how to use NextAuth.js with Next.js. The example features adding sign in, and an authenticated API route to your Next.js application.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app -e https://github.com/tsuki-lab/nextjs-with-nextauth
yarn create next-app -e https://github.com/tsuki-lab/nextjs-with-nextauth
pnpm create next-app -e https://github.com/tsuki-lab/nextjs-with-nextauth

Deploy it to the cloud with Vercel (Documentation).

Getting started

Read the https://next-auth.js.org/providers/google ahead.

Environment variables

GOOGLE_ID=
GOOGLE_SECRET=
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET= # generate with `openssl rand -base64 32`

About

Adapted next-auth.js to Next.js.

https://nextjs-with-nextauth-murex.vercel.app


Languages

Language:TypeScript 90.5%Language:CSS 8.6%Language:JavaScript 0.9%