我正在尝试构建一个 Foursquare 应用程序,并且我选择了 Everyauth 模块来实现身份验证(与 Foursquare 连接)。
我收到错误
Error: Step getAccessToken of `foursquare` module timed out.
在用户允许该应用程序后。这是我正在使用的代码:
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('<html><head></head><body><a href="' + helper.getAuthUrl() + '">Connect with Foursquare</a></body></html>');
});
everyauth.helpExpress(app);
app.listen(4040);