mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
fix: #9822, use correct username/pwd
This commit is contained in:
@@ -12,7 +12,7 @@ connection.getConnectionString = function (mongo) {
|
|||||||
let usernamePassword = '';
|
let usernamePassword = '';
|
||||||
const uri = mongo.uri || '';
|
const uri = mongo.uri || '';
|
||||||
if (mongo.username && mongo.password) {
|
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('@'))) {
|
} else if (!uri.includes('@') || !uri.slice(uri.indexOf('://') + 3, uri.indexOf('@'))) {
|
||||||
winston.warn('You have no mongo username/password setup!');
|
winston.warn('You have no mongo username/password setup!');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user