Skip to content

Commit

Permalink
wip: auth.js expects clientPromise
Browse files Browse the repository at this point in the history
  • Loading branch information
aldosch committed Jun 18, 2024
1 parent 018c3cd commit 08c04d4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import NextAuth from 'next-auth';
import GitHubProvider from 'next-auth/providers/github';
import { MongoDBAdapter } from '@next-auth/mongodb-adapter';
import clientPromise from 'lib/mongodb';
import client from 'lib/mongodb';

export default NextAuth({
adapter: MongoDBAdapter(clientPromise),
// TODO: investigate Auth.js required changes to accomodate new `client` method
// These docs reference the old `clientPromise` method:
// https://authjs.dev/getting-started/adapters/mongodb#configuration
// Pulled from:
// https://github.com/vercel/next.js/tree/canary/examples/with-mongodb
adapter: MongoDBAdapter(client),
providers: [
GitHubProvider({
clientId: process.env.GITHUB_CLIENT_ID,
Expand Down

0 comments on commit 08c04d4

Please sign in to comment.