2011-09-25 172 views
1

使用everyauth,第一次用戶登錄時,配置文件通過貓鼬添加到我的MongoDB中,並且會話運行良好。用戶試圖第二次登陸,並出現以下錯誤服務器崩潰:Everyauth,第一次登錄工作,第二次登錄失敗

/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/modules/everymodule.js:352 throw err;

^ TypeError: Cannot read property 'id' of undefined at Object._addToSession (/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/modules/oauth2.js:195:46) at Object.exec (/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/step.js:48:21) at /mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/stepSequence.js:19:38 at [object Object].fulfill (/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/promise.js:42:25) at /mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/stepSequence.js:22:23 at [object Object].callback (/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/promise.js:13:12) at /mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/stepSequence.js:21:23 at [object Object].fulfill (/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/promise.js:42:25) at /mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/stepSequence.js:22:23 at [object Object].fulfill (/mnt/ws/users/guiomie/70543/node_modules/everyauth/lib/promise.js:42:25)

以下是我的代碼:

​​

我用貓鼬和表達。

回答

3

未經檢驗的,但看你的代碼,它看起來像你需要改變這一行:

user = result.doc; 

這樣:

user = result; 
+0

非常感謝你,它的工作原理。我不知道這是怎麼溜進去的。 – guiomie

相關問題