DEV Community

Robinson Loreto
Robinson Loreto

Posted on

1 2

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay