mongodb auth db
This commit is contained in:
parent
b5820dafde
commit
ede532df4c
@ -11,6 +11,7 @@ MONGO_PORT=27017
|
||||
MONGO_USER=
|
||||
MONGO_PASS=
|
||||
MONGO_DB=framework-proto
|
||||
MONGO_AUTH_DB=auth
|
||||
|
||||
# Encryption secret
|
||||
CRYPTO_SECRET=verySecretSecret
|
||||
|
@ -34,7 +34,7 @@ class Server extends EventEmitter {
|
||||
|
||||
const { MARIA_HOST, MARIA_USER, MARIA_PORT, MARIA_PASS, MARIA_DB,
|
||||
MONGO_HOST, MONGO_USER, MONGO_PORT, MONGO_PASS, MONGO_DB,
|
||||
NODE_ENV, SECRET, CRYPTO_SECRET, CRYPTO_SALT } = process.env;
|
||||
NODE_ENV, SECRET, CRYPTO_SECRET, CRYPTO_SALT, MONGO_AUTH_DB } = process.env;
|
||||
const { http: httpOpts, databases, validUserTypes } = options;
|
||||
|
||||
// This key never leaves memory and is exclusively used on the server, the salt can stay static
|
||||
@ -66,7 +66,7 @@ class Server extends EventEmitter {
|
||||
// Mariadb isn't strictly necessary here for anything, it's just here pre-emptively
|
||||
this.mariadb = new MariaDB(this, { options: databases.mariadb, MARIA_HOST, MARIA_USER, MARIA_PORT, MARIA_PASS, MARIA_DB });
|
||||
// Mongo is used for session and user storage
|
||||
this.mongodb = new MongoDB(this, { options: databases.mongodb, MONGO_HOST, MONGO_USER, MONGO_PORT, MONGO_PASS, MONGO_DB });
|
||||
this.mongodb = new MongoDB(this, { options: databases.mongodb, MONGO_HOST, MONGO_USER, MONGO_PORT, MONGO_PASS, MONGO_DB, MONGO_AUTH_DB });
|
||||
this.userDatabase = new UserDatabase(this, this.mongodb, { validUserTypes });
|
||||
// Alias
|
||||
this.users = this.userDatabase;
|
||||
@ -102,9 +102,6 @@ class Server extends EventEmitter {
|
||||
},
|
||||
crossOriginResourcePolicy: {
|
||||
policy: 'cross-origin'
|
||||
},
|
||||
crossOriginEmbedderPolicy: {
|
||||
policy: 'require-corp'
|
||||
}
|
||||
}));
|
||||
this.app.use(express.json({ limit: '10mb' }));
|
||||
|
Loading…
Reference in New Issue
Block a user