var logger = require('lib/logger')(module);
var async = require('async');
var User = require('models/user').User;
var HttpError = require('error').HttpError;

exports.get = function (req, res, next) {
    res.render('login');
};

exports.post = function (req, res, next) {
    async.waterfall([
        function (callback) {
            User.findOne({ username: req.body.username }).exec(callback);
        },
        function (user, callback) {
            if (!user) {
                res.sendHttpError(new HttpError(403));
            } else {
                if (user.checkPassword(req.body.password)) {
                    callback(null, user);
                } else {
                    res.sendHttpError(new HttpError(403));
                }
            }
        }
    ],
        function (err, user) {
            if (err) {
                return next(err);
            }

            req.session.user = user._id;
            res.redirect("/map");
        }
    );

};


@@ -480,33 +480,24 @@
         
-res.sendHttpError
+callback
 (new Htt
@@ -683,25 +683,16 @@
     
-res.sendHttpError
+callback
 (new
@@ -758,20 +758,16 @@
 %0A    %5D,%0A
-    
     func
@@ -789,28 +789,24 @@
 ) %7B%0A        
-    
 if (err) %7B%0A 
@@ -800,28 +800,24 @@
  if (err) %7B%0A
-    
             
@@ -846,26 +846,19 @@
     
-    %7D%0A%0A   
+%7D%0A%0A
         
  req
@@ -853,17 +853,16 @@
         
- 
 req.sess
@@ -890,20 +890,16 @@
         
-    
 res.redi
@@ -916,26 +916,17 @@
 %22);%0A    
-  
-  %7D%0A    
+%7D
 );%0A%0A%7D;%0A%0A

Use async.js properly in routes/login.js