Skip to content

Instantly share code, notes, and snippets.

View boicualexandru's full-sized avatar

Alex Boicu boicualexandru

  • Cluj-Napoca, Romania
View GitHub Profile
@waptik
waptik / fauna-adapter.js
Last active December 31, 2020 17:18 — forked from s-kris/fauna-adapter.js
faunadb adapter for next-auth for next.js
/**
* This is a faunadb adapter for next-auth
* original source: https://gist.github.com/s-kris/fbb9e5d7ba5e9bb3a5f7bd11f3c42b96
* create collections and indexes in your faunadb shell(dashboard or cli) using the following queries:
CreateCollection({name: 'accounts'});
CreateCollection({name: 'sessions'});
CreateCollection({name: 'users'});
CreateCollection({name: 'verification_requests'});
@s-kris
s-kris / fauna-adapter.js
Last active April 19, 2022 12:54
faunadb adapter for next-auth for next.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';