parse.com - Where does request.user come from in Parse Server -
i'm trying port parse.com app parse server.
according parse migration guide, parse.user.current() can no longer used , instead should fetch current user via 'request.user'.
however, request.user undefined me.
for example, when login user , redirect path (/mypath), incoming request @ mypath not contain user object.
parse.user.login(username, password, { success: function(user) { res.redirect('/mypath'); } }) // index of /mypath controller exports.index = function(request, response) { // request.user undefined here }
how work active user after logged in sucessfully?
i think figured out.
when working in cloud code there no magic request.user. rather when logging in need manually store user info in current session. in parse.com days would've been managed parse-express-cookie-session middleware. explained in cloud code guide. parse-server can insert own middleware manage user described here.
however, request.user available when receiving requests client sdk using authenticated user.
Comments
Post a Comment