M
M
MajorTom692018-10-07 16:57:12
Frontend
MajorTom69, 2018-10-07 16:57:12

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

1 answer(s)
A
AlexKindGeek, 2018-10-07
@MajorTom69

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 question

Ask a Question

731 491 924 answers to any question