Skip to content

Instantly share code, notes, and snippets.

Avatar

Sai Krishna s-kris

View GitHub Profile
@s-kris
s-kris / fauna-adapter.js
Last active Jun 28, 2021
faunadb adapter for next-auth for next.js
View fauna-adapter.js
// followed from next-auth repo: https://github.com/nextauthjs/next-auth
// create faunadb server key
// create collections: users, accounts, sessions, verificationRequests
// create required indexes
import faunadb, { query as q } from 'faunadb';
import { v4 as uuidv4 } from 'uuid';
import { createHash, randomBytes } from 'crypto';