title: Everyauth - connect with Foursquare
body: <p>I'm trying to build a Foursquare app and I've selected the Everyauth module to implement the authentication (Connect with Foursquare).</p>
  
  <p>I'm getting the error</p>
  
  <pre><code>Error: Step getAccessToken of `foursquare` module timed out.
  </code></pre>
  
  <p>after the user allows the app. Here is the code I'm using:</p>
  
  <pre><code>var express = require('express'),
          util = require('util'),
          helper = require('./helper'),
          settings = require('./settings').appSettings,
          everyauth = require('everyauth');
  
  everyauth.foursquare
    .entryPath('/auth/foursquare')
    .callbackPath('/auth/foursquare/callback');
  
  //everyauth.everymodule.moduleTimeout(-1);
  
  everyauth.foursquare
    .appId(settings.appId)
    .appSecret(settings.appSecret)
    .findOrCreateUser( function (session, accessToken, accessTokenExtra, foursquareUserMetadata) {
      util.inspect(arguments);
      return {};
    })
    .redirectPath('/');
  
    var app = express.createServer(
        express.bodyParser()
      , express.static(__dirname + "/public")
      , express.favicon()
      , express.cookieParser()
      , express.session({ secret: '*****'})
      , everyauth.middleware()
    );
  
  app.get('/', function (req, res) {
      res.writeHead(200, {'Content-Type': 'text/html'});
      res.end('&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;a href="' + helper.getAuthUrl() + '"&gt;Connect with Foursquare&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;');
  });
  
  everyauth.helpExpress(app);
  
  app.listen(4040);
  </code></pre>