parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

implement parseExpressCookieSession

Open lucianmat opened this issue 10 years ago • 18 comments

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 ?

lucianmat avatar Jan 31 '16 09:01 lucianmat

Going to close this since it's not really an issue with the server.

gfosco avatar Feb 04 '16 18:02 gfosco

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?

tayutaedomo avatar Feb 14 '16 07:02 tayutaedomo

It's a good idea.. hopefully someone will take a crack at implementing it and send a PR.

gfosco avatar Feb 14 '16 10:02 gfosco

+1

enjoyjeremy-bc avatar Feb 23 '16 03:02 enjoyjeremy-bc

Posted one example implementation of the parse-express-cookie-session here #497. Would be great to have it included in parse-server though.

simonbengtsson avatar Feb 28 '16 22:02 simonbengtsson

It's available here already: https://github.com/flovilmart/parse-express-cookie-session

flovilmart avatar Feb 28 '16 23:02 flovilmart

Ah sweet. Drop in replacement?

simonbengtsson avatar Feb 29 '16 00:02 simonbengtsson

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!

flovilmart avatar Feb 29 '16 00:02 flovilmart

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?

simonbengtsson avatar Feb 29 '16 00:02 simonbengtsson

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

flovilmart avatar Feb 29 '16 00:02 flovilmart

And Parse.User.currentUser() is provided by the middleware so it is exposed properly in cloud code as well

flovilmart avatar Feb 29 '16 13:02 flovilmart

Closing this for now.. pr still welcomed.

gfosco avatar Mar 21 '16 12:03 gfosco

@flovilmart Which middleware you use to populate Parse.User.currentUser()

GuichiZhao avatar May 02 '16 05:05 GuichiZhao

@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!

GuichiZhao avatar May 02 '16 05:05 GuichiZhao

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?

mnearents avatar Nov 16 '16 19:11 mnearents

Pares-express-cookie-session should be avoided. I need to take it down.

flovilmart avatar Nov 16 '16 20:11 flovilmart

@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?

lkraider avatar Mar 10 '17 21:03 lkraider

It leverage Parse.User.logIn which is not ideal

flovilmart avatar Mar 13 '17 13:03 flovilmart