mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-31 04:33:09 +08:00
v1.0.19. fixed broken auth
This commit is contained in:
parent
c3bc7a091f
commit
f7721041e7
2 changed files with 9 additions and 5 deletions
|
@ -40,7 +40,6 @@ class UserHandler {
|
|||
* @param {String} username Either username or email address
|
||||
*/
|
||||
authenticate(username, password, callback) {
|
||||
|
||||
let checkAddress = next => {
|
||||
if (username.indexOf('@') < 0) {
|
||||
// assume regular username
|
||||
|
@ -62,16 +61,22 @@ class UserHandler {
|
|||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
if (!addressData) {
|
||||
return callback(null, false);
|
||||
}
|
||||
|
||||
return next(null, {
|
||||
_id: addressData.user
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
checkAddress(query => {
|
||||
checkAddress((err, query) => {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
this.database.collection('users').findOne(query, {
|
||||
fields: {
|
||||
username: true,
|
||||
|
@ -80,7 +85,6 @@ class UserHandler {
|
|||
asp: true
|
||||
}
|
||||
}, (err, userData) => {
|
||||
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
@ -113,7 +117,7 @@ class UserHandler {
|
|||
user: userData._id,
|
||||
username: userData.username,
|
||||
scope: 'application',
|
||||
use2fa: false
|
||||
enabled2fa: false // application scope never requires 2FA
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "wildduck",
|
||||
"version": "1.0.18",
|
||||
"version": "1.0.19",
|
||||
"description": "IMAP server built with Node.js and MongoDB",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in a new issue