From 9d3453d6456fc48d57c69441d296fc83d62694e3 Mon Sep 17 00:00:00 2001 From: Andris Reinman Date: Wed, 20 Dec 2017 15:17:34 +0200 Subject: [PATCH] fixed password update --- lib/db.js | 12 ++++++------ lib/user-handler.js | 2 +- package.json | 13 +++++-------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/db.js b/lib/db.js index 50504c39..1f4b4735 100644 --- a/lib/db.js +++ b/lib/db.js @@ -36,21 +36,21 @@ module.exports.connect = callback => { return callback(err); } module.exports.database = db; - getDBConnection(db, config.dbs.gridfs, (err, db) => { + getDBConnection(db, config.dbs.gridfs, (err, gdb) => { if (err) { return callback(err); } - module.exports.gridfs = db; - getDBConnection(db, config.dbs.users, (err, db) => { + module.exports.gridfs = gdb; + getDBConnection(db, config.dbs.users, (err, udb) => { if (err) { return callback(err); } - module.exports.users = db; - getDBConnection(db, config.dbs.sender, (err, db) => { + module.exports.users = udb; + getDBConnection(db, config.dbs.sender, (err, sdb) => { if (err) { return callback(err); } - module.exports.senderDb = db; + module.exports.senderDb = sdb; module.exports.redisConfig = tools.redisConfig(config.dbs.redis); module.exports.redis = new Redis(module.exports.redisConfig); diff --git a/lib/user-handler.js b/lib/user-handler.js index 9e811e67..4c3e0339 100644 --- a/lib/user-handler.js +++ b/lib/user-handler.js @@ -1840,7 +1840,7 @@ class UserHandler { $set.unameview = $set.username.replace(/\./g, ''); } - if (!updates) { + if (!updates && !passwordChanged) { return callback(new Error('Nothing was updated')); } diff --git a/package.json b/package.json index 9bc983e8..3f9d9dc0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wildduck", - "version": "1.0.94", + "version": "1.0.95", "description": "IMAP server built with Node.js and MongoDB", "main": "server.js", "scripts": { @@ -8,10 +8,7 @@ "test": "mongo --eval 'db.dropDatabase()' wildduck-test && redis-cli -n 13 flushdb && NODE_ENV=test grunt", "apidoc": "apidoc -i lib/api/ -o docs/" }, - "keywords": [ - "imap", - "mail server" - ], + "keywords": ["imap", "mail server"], "author": "Andris Reinman", "license": "EUPL-1.1", "devDependencies": { @@ -49,12 +46,12 @@ "libmime": "3.1.0", "libqp": "1.1.0", "linkify-it": "2.0.3", - "mailsplit": "4.0.2", + "mailsplit": "4.1.1", "mobileconfig": "2.1.0", "mongo-cursor-pagination-node6": "5.0.0", - "mongodb": "2.2.33", + "mongodb": "3.0.0-rc0", "mongodb-extended-json": "^1.10.0", - "nodemailer": "4.4.0", + "nodemailer": "4.4.1", "npmlog": "4.1.2", "openpgp": "2.6.0", "qrcode": "1.0.0",