title: Sails.js: error logging in with passport
body: <p>When this part of my code gets executed:</p>
  
  <pre><code>req.login(user, function (err){
      if (err) return res.negotiate(err);
      return res.redirect('/welcome');
  });
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>/home/oriol/Desktop/containers/node_modules/sails-mongo/node_modules/mongodb/lib/utils.js:98
      process.nextTick(function() { throw err; });
                                    ^
  
  Error: passport.initialize() middleware not in use
      at IncomingMessage.req.login.req.logIn (/home/oriol/Desktop/containers/node_modules/passport-local/node_modules/passport/lib/passport/http/request.js:30:30)
      at /home/oriol/Desktop/containers/api/controllers/AuthController.js:37:15
      at wrapper (/home/oriol/Desktop/containers/node_modules/lodash/index.js:3592:19)
      at applyInOriginalCtx (/home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/utils/normalize.js:421:80)
      at wrappedCallback (/home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/utils/normalize.js:324:18)
      at success (/home/oriol/Desktop/containers/node_modules/waterline/node_modules/switchback/lib/normalize.js:33:31)
      at _switch (/home/oriol/Desktop/containers/node_modules/waterline/node_modules/switchback/lib/factory.js:58:28)
      at /home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/query/dql/create.js:248:9
      at /home/oriol/Desktop/containers/node_modules/async/lib/async.js:52:16
      at /home/oriol/Desktop/containers/node_modules/async/lib/async.js:269:32
      at /home/oriol/Desktop/containers/node_modules/async/lib/async.js:44:16
      at child.&lt;anonymous&gt; (/home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/utils/schema.js:152:44)
      at fn (/home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/utils/callbacksRunner.js:60:10)
      at /home/oriol/Desktop/containers/node_modules/async/lib/async.js:181:20
      at iterate (/home/oriol/Desktop/containers/node_modules/async/lib/async.js:262:13)
      at Object.async.forEachOfSeries.async.eachOfSeries (/home/oriol/Desktop/containers/node_modules/async/lib/async.js:281:9)
      at Object.async.forEachSeries.async.eachSeries (/home/oriol/Desktop/containers/node_modules/async/lib/async.js:214:22)
      at Object.runner.afterCreate (/home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/utils/callbacksRunner.js:63:9)
      at after (/home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/query/dql/create.js:243:17)
      at /home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/query/dql/create.js:230:68
      at wrapper (/home/oriol/Desktop/containers/node_modules/lodash/index.js:3592:19)
      at applyInOriginalCtx (/home/oriol/Desktop/containers/node_modules/waterline/lib/waterline/utils/normalize.js:421:80)
  </code></pre>
  
  <p>I have read other posts about the same issue but none of them seems to fix it. I don't know much about why is this happening, feel free to ask for further explanation or any piece of code that might be relevant. Thanks!</p>