nodejs中everyauth模块,实现登陆第三方登陆Facebook时提示超时怎么解决??
发布于 9 年前 作者 boring2 4496 次浏览 最后一次编辑是 8 年前 来自 问答

我把我在stackoverflow的帖子贴过来了,希望有人能帮忙解答下,谢谢. 500 Error: Step getAccessToken of facebook module timed out. I use nodejs version 0.12.2

“express”: “^4.13.3”,

“everyauth”: “^0.4.9”,

errors out after a few seconds with

starting step - getAuthUri …finished step

starting step - requestAuthUri …finished step

GET /auth/facebook 303 3.463 ms - - starting step - getCode …finished step

starting step - getAccessToken Error: Step getAccessToken of facebook module timed out.

at /Users/Boring/node.js/ch6/blog_v3/node_modules/everyauth/lib/step.js:132:14

at null.<anonymous> (/Users/Boring/node.js/ch6/blog_v3/node_modules/everyauth/lib/promise.js:69:23)

at Timer.listOnTimeout (timers.js:110:15)

GET /admin?code=AQAR9DmL-PjT6DucpbaifdQkITQU_vRLbztD-kwer5W778HugGP8xC-u-SaV7VS7s2EErvGeN0c9XCbi-vxztQ-ZqYwipOR8GwmZkJeqb2DtIrx6D_L1Wid2Kva5ZYAgIctclImBDsUJ6ifVkbd0ErMEBT2xukonHh0lywWTE5Lkh–Fme4dITWvCVfR_KYzZK5T_Bkx_b5oCKJvSmUYF2SwKAfegoMQA1PjL7jNMzmooFxFeOH9wshifh2KKBpbPZxU3-SNmJDcXCOhKUTw3jo29Nj8CTfdSo9ZiUl2byey3F6iep_lBx5HK7dM0dPpfnIZ5SzCLsyEIHlJSDr144F5 500 10012.878 ms - -

In my program I write like this:

everyauth.facebook 
   .appId('14799796...') 
   .appSecret('68bc0aeb6d56b8f....')
   .handleAuthCallbackError(function(req, res) { 
   }) 
   .findOrCreateUser(function(session, accessToken, accessTokExtra, fbUserMetaData) { 
            var promise = this.Promise(); 
            promise.fulfill('test'); 
            return promise; 
   }) 
   

everyauth.facebook.entryPath('/auth/facebook').callbackPath('/admin')

I have created a application in Facebook and set advanced setting like this

Valid OAuth redirect URIs http://local.host:3000/admin

and I set my compute hosts file

127.0.0.1 localhost local.host

I use the development OS is Mac OS X. I have tried my best to search solve way but can’t work. Thank you for your answer.

回到顶部