From cd99000a57707c8d074ae4d4704225b0f507fbc2 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 7 Nov 2023 21:49:47 +0100 Subject: [PATCH] follow guidelines --- pages/api/auth/[...nextauth].ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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() }