Skip to content

Instantly share code, notes, and snippets.


Sai Krishna s-kris

View GitHub Profile
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:
// 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';