Access Flask session with ReactJS

Viewed 5255

I have a Python Flask server serving not only an webapp but also a set of routes, sort of like an API.

In this webapp, I'm using only ReactJS, as in the HTML code is simply a div and ReactJS puts everything in place from there.

Only problem is: Flask is taking care of the login process, which means only Flask has access to the credentials of the user and the result of the login. For the ReactJS interface to work properly, it needs an ID (most likely a huge string) of the user and other additional info. I could easily stash that info on Flask's session, but how can ReactJS read it?

Any suggestions?

1 Answers
Related