L
L
lordprotein2020-04-21 19:42:37
Node.js
lordprotein, 2020-04-21 19:42:37

How to protect the paths?

There is a React application and a server with express.js + mySQL.
Task: to allow only those users who are authorized in the application to access the paths.
Tried to use Passport.js, but with each call it resets the authorization.
Grateful for any hint.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
real2210, 2020-04-21
@real2210

Private route in react-router

R
Robur, 2020-04-22
@Robur

Tried to use Passport.js, but with each call it resets the authorization.

this is the right way, understand why it "resets authorization"
and in general it is not clear how your users log in to the application if there is no authorization support on the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question