From 5691b595adecfa832f473331d9206b7124c5b978 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 21 Jun 2022 22:57:23 +0200 Subject: [PATCH] Revert "use atlas integration env var" This reverts commit ce01da812ded696bdb12f7422cfc24315d2f92ee. --- db/index.ts | 4 ++-- pages/api/auth/[...nextauth].ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/index.ts b/db/index.ts index 7b833d3..08a5d33 100644 --- a/db/index.ts +++ b/db/index.ts @@ -7,14 +7,14 @@ import { uniqueFilter } from '../helpers/array' let connectedPromise: Promise -export const MONGODB_URI = process.env.MONGODB_URI +export const MONGO_URI = process.env.MONGO_URI export function connect(): Promise { if (connectedPromise) { return connectedPromise } - connectedPromise = mongoose.connect(MONGODB_URI) + connectedPromise = mongoose.connect(process.env.MONGO_URI) return connectedPromise } diff --git a/pages/api/auth/[...nextauth].ts b/pages/api/auth/[...nextauth].ts index 60bba4a..f82c71f 100644 --- a/pages/api/auth/[...nextauth].ts +++ b/pages/api/auth/[...nextauth].ts @@ -4,7 +4,7 @@ import EmailProvider from 'next-auth/providers/email' import GitHubProvider from 'next-auth/providers/github' import { MongoDBAdapter } from '@next-auth/mongodb-adapter' -import { MONGODB_URI } from '../../../db' +import { MONGO_URI } from '../../../db' import { MongoClient } from 'mongodb' let client: MongoClient @@ -14,7 +14,7 @@ const GITHUB_USERS_GRANTED = ['111471'] async function getMongoClient() { if (!client) { - client = new MongoClient(MONGODB_URI) + client = new MongoClient(MONGO_URI) await client.connect() }