Development (#14)

Co-authored-by: PineaFan <ash@pinea.dev>
Co-authored-by: pineafan <pineapplefanyt@gmail.com>
Co-authored-by: PineappleFan <PineaFan@users.noreply.github.com>
Co-authored-by: Skyler <skyler3665@gmail.com>
pull/17/head
Samuel Shuert 3 years ago committed by GitHub
parent 3621bf9afe
commit 31d438fb2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,11 +9,12 @@ import defaultData from '../config/default.js';
const username = encodeURIComponent(config.mongoOptions.username); const username = encodeURIComponent(config.mongoOptions.username);
const password = encodeURIComponent(config.mongoOptions.password); const password = encodeURIComponent(config.mongoOptions.password);
const mongoClient = new MongoClient(username ? `mongodb://${username}:${password}@${config.mongoOptions.host}?authMechanism=DEFAULT` : `mongodb://${config.mongoOptions.host}`, {authSource: "admin"});
const mongoClient = new MongoClient(username ? `mongodb://${username}:${password}@${config.mongoOptions.host}?authMechanism=DEFAULT` : `mongodb://${config.mongoOptions.host}`, {authSource: config.mongoOptions.authSource});
await mongoClient.connect(); await mongoClient.connect();
const database = mongoClient.db(); const database = mongoClient.db();
const collectionOptions = { authdb: "admin" }; const collectionOptions = { authdb: config.mongoOptions.authSource, w: "majority" };
const getIV = () => crypto.randomBytes(16); const getIV = () => crypto.randomBytes(16);

Loading…
Cancel
Save