DEV Community

Robinson Loreto
Robinson Loreto

Posted on

Reactjs Login

Hi, how are you? I am just starting to develop an application with ReactJS, with a backend connected to a BD Sql Server. What I want is for you to help me with the logic when I start the session. Currently I keep Locally with the LocalStorage the token generated by the backend and besides this I handle in a global state with redux a variable "is_logged" that takes me true when the start is correct and false when it is not correct. What I do not know is how to handle, from that variable "is_logged" the redirection to, for example: / dashboard, and to protect all the routes within that dashboard, and also, if it is located in the login and is already logged ignore and stay on the dashboard the same. I hope you can help me ! Greetings from Venezuela.

Top comments (0)