fix: #9822, use correct username/pwd

This commit is contained in:
Barış Soner Uşaklı
2021-09-22 09:16:08 -04:00
parent 2add84a568
commit 30f387710c

View File

@@ -12,7 +12,7 @@ connection.getConnectionString = function (mongo) {
let usernamePassword = '';
const uri = mongo.uri || '';
if (mongo.username && mongo.password) {
usernamePassword = `${nconf.get('mongo:username')}:${encodeURIComponent(nconf.get('mongo:password'))}@`;
usernamePassword = `${mongo.username}:${encodeURIComponent(mongo.password)}@`;
} else if (!uri.includes('@') || !uri.slice(uri.indexOf('://') + 3, uri.indexOf('@'))) {
winston.warn('You have no mongo username/password setup!');
}