Skip to content

Latest commit

 

History

History
 
 

with-nextauth-credentials

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

GraphCMS ⨯ NextAuth.js

Join our Slack

This example demonstrates how to query from GraphCMS NextAuth.js.

Users can login or register using the same form (for the purposes of this demo), and update their profile name/bio.

NextAuth.js has a REST API you should use to create custom login pages.

Demo

Deploy with Vercel

How to Use

You will need to create a Permanent Auth Token to use this example locally.

Inside of .env add the following:

GRAPHCMS_ENDPOINT=
GRAPHCMS_TOKEN=
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=somethingsupersecret

You will need to set NEXTAUTH_URL as your actual URL if deploying.

You will also need to follow instructions here to configure the models this project needs to work.

Download Manually

npx degit graphcms/graphcms-examples/with-nextauth-credentials with-nextauth-credentials

Install & Run:

cd with-nextauth-credentials
npm install
npm run dev
# or
cd with-nextauth-credentials
yarn
yarn dev

Run on Codesandbox

Develop with Codesandbox