emanuelelongo / react-ssr-starter-kit

React / Redux starter kit with server side rendering
4 stars 1 forks source link

Question: SSR backend requests with cookie auth #3

Open asnapper opened 5 years ago

asnapper commented 5 years ago

I started off with your example code and built a backend using passport/jwt with bearer and cookie extractors for authentication. During SSR, requesting stuff from authenticated endpoints fails, as i have no reference to the original request to the react route, which would contain the required jwt cookie.

is there a way to get the request object for Class.requirements?

Thanks

emanuelelongo commented 5 years ago

I had similar (and multiple) problems so I recently changed approach. Now the react-ssr-starter-kit (I also had to change the name) expose an Express Middleware only responsible to render the react content. Every other server responsibility is left outside the package. Please look at the version 5 that I just published, in particular way the example app.

Thanks, Emanuele