follow guidelines

This commit is contained in:
Thomas Ruoff
2023-11-07 21:49:47 +01:00
parent 7f0aa5fec6
commit cd99000a57

View File

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