diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts index ee685ef..084527f 100644 --- a/pages/api/auth/[...nextauth].ts +++ b/pages/api/auth/[...nextauth].ts @@ -5,7 +5,7 @@ import GitHubProvider from 'next-auth/providers/github' import { MongoDBAdapter } from '@next-auth/mongodb-adapter' import { MONGO_URI } from '../../../db' -import { MongoClient } from 'mongodb' +import { MongoClient, ServerApiVersion } from 'mongodb' let client: MongoClient @@ -14,7 +14,13 @@ const GITHUB_USERS_GRANTED = ['111471'] async function getMongoClient() { if (!client) { - client = new MongoClient(MONGO_URI) + client = new MongoClient(MONGO_URI, { + serverApi: { + version: ServerApiVersion.v1, + strict: true, + deprecationErrors: true, + } + }) await client.connect() }