implement parseExpressCookieSession
Is there any way to get user session token from get request not processed by parse-server ?
After user is logged in with Parse.User.Login, to navigate to protected web pages ?
I think something similar with parseExpressCookieSession ?
Going to close this since it's not really an issue with the server.
Hi, @gfosco
Now I try migration using the parse-server but I have a similar problem.
I have used parseExpressCookieSession in Cloud Code.
Do the parse-server have a plan to support parseExpressCookieSession?
It's a good idea.. hopefully someone will take a crack at implementing it and send a PR.
+1
Posted one example implementation of the parse-express-cookie-session here #497. Would be great to have it included in parse-server though.
It's available here already: https://github.com/flovilmart/parse-express-cookie-session
Ah sweet. Drop in replacement?
yes, at one point I reimplemented all the parse-cloud dependencies as drop-in replacements. They are available in parse-anywhere which is a drop in replacement for Cloud code. It's running in production, on GAE with docker and that requires 0 code changes compared to cloud-code deployment.
I want to move it forward into a real parse-cloud-code-server, open to PR's and make the transition easier for everyone, including not rewrite a single line for cloud code!
Sounds great! Briefly looked through the repo and saw a Parse.User.current(). Not supported in parse-server right? Plus dependency on express 3 instead of 4 so I guess for example the res.on code would have to be changed somehow if using that?
the dep on express3 was to match exactly the cloud code implementation , this is actually a fork of express 3 without the need to pass a port for listening :)
PR are welcome for that, I've been using it for a while now and it's stable and robust, besides some weird behaviour in parse-image that I'll happily rewrite without gm/imagemagick as it breaks on some non debian installations
And Parse.User.currentUser() is provided by the middleware so it is exposed properly in cloud code as well
Closing this for now.. pr still welcomed.
@flovilmart Which middleware you use to populate Parse.User.currentUser()
@flovilmart
I suppose Parse.Cloud._expressCookieEncryptionKey() is also set by you,maybe you do significant work on Parse Cloud .However what I want is just parseExpressCookieSession .I suppose a standalone parseExpressCookieSession middleware compatible to official parse-server will benefit more
@gfosco Is official support for parseExpressCookieSession ready ?
Thanks!
This might be a dumb question, but @flovilmart if I've already re-written my cloud code to run in a node environment, then the parse-express-cookie-session is no longer a drop-in solution correct?
Pares-express-cookie-session should be avoided. I need to take it down.
@flovilmart I am getting "There is no current user user on a node.js server environment" with your npm module.
What about https://github.com/back4app/parse-express-cookie-session ? Anyone tried that?
It leverage Parse.User.logIn which is not ideal