More preparations for 2 factor authentication

This commit is contained in:
Fabian Stamm
2018-11-10 15:12:38 +01:00
parent 7389c25312
commit 0633311ba1
11 changed files with 62 additions and 119 deletions

View File

@ -1,3 +1,11 @@
import SafeMongo from "@hibas123/safe_mongo";
const DB = new SafeMongo("mongodb://localhost", "openauth");
import Config from "./config"
let dbname = "openauth"
let host = "localhost"
if (Config.database) {
if (Config.database.database) dbname = Config.database.database;
if (Config.database.host) host = Config.database.host;
}
if (Config.dev) dbname += "_dev";
const DB = new SafeMongo("mongodb://" + host, dbname);
export default DB;