Answer the question
In order to leave comments, you need to log in
How to prevent access to the page without authentication in a React project?
Is it really necessary to hang up a check on each page whether the user is logged in or not, and if not, redirect to the login page?
Answer the question
In order to leave comments, you need to log in
You can use a Private Route
Or you can make a HOC that takes a token from the store and checks
If there is a token, let it, if not go to login page
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question