Is it possible to retrieve a session via a proxy with create-react-app ?
So create-react-app allows users to specify proxies for api endpoints or whatever.
I have created an endpoint http://localhost:1555/auth/login that will login in a user if their credentials are correct and set a session for them. The app will then redirect them back to the create-react-app account page I have set up. (Keep in mind this CRA so it's in localhost:3000). This API endpoint is using the Java Spring framework.
So in my create-react-app project, I simply proxy the url I made inside the package.json and I have a nice form that will post to that Java spring endpoint…but my session does not get set because…why ? Is it because they are in different ports ? Do I need to set some headers in my post ? Is the redirect causing problems ? The sessions are set but only on the api endpoint localhost:1555, not localhost:3000. Since I am using Spring, I get a jsessionid on my cookies, could I use that somehow when I make another api request ? If you need more info ask, any help or direction would be appreciated.
Submitted July 12, 2017 at 10:11PM by HappyZombies
via reddit http://ift.tt/2t5QwKV