Permalink
Browse files

Minor fix: make sure plugins return after session is reset

  • Loading branch information...
1 parent 794c836 commit cfae593522b29f81c04f734aec89300b5f3478c0 @smfreegard smfreegard committed Jun 26, 2014
Showing with 6 additions and 4 deletions.
  1. +6 −4 plugins/auth/auth_base.js
View
@@ -82,8 +82,9 @@ exports.check_user = function (next, connection, credentials, method) {
connection.notes.authenticating = false;
if (!(credentials[0] && credentials[1])) {
connection.respond(504, "Invalid AUTH string", function () {
- connection.reset_transaction();
- return next(OK);
+ connection.reset_transaction(function () {
+ return next(OK);
+ });
});
return;
}
@@ -111,8 +112,9 @@ exports.check_user = function (next, connection, credentials, method) {
connection.auth_results('auth=fail ('+method.toLowerCase()+') smtp.auth='+ credentials[0]);
setTimeout(function () {
connection.respond(535, "Authentication failed", function () {
- connection.reset_transaction();
- return next(OK);
+ connection.reset_transaction(function () {
+ return next(OK)
+ });
});
}, delay * 1000);
}

0 comments on commit cfae593

Please sign in to comment.