0
我試圖將我的Parse.com應用程序移植到Parse服務器。request.user來自Parse服務器
根據Parse遷移指南,不再可以使用Parse.User.current(),而應該通過'request.user'來獲取當前用戶。
但是,request.user總是未定義給我。
例如,當我成功登錄一個用戶然後重定向到另一個路徑(/ mypath)時,mypath中的傳入請求不包含用戶對象。
Parse.User.logIn(username, password, {
success: function(user) {
res.redirect('/mypath');
}
})
// Index of the /mypath controller
exports.index = function(request, response) {
// request.user is undefined here
}
如何與活躍用戶工作,我登錄後成功地?