Answer the question
In order to leave comments, you need to log in
How to arrange authorization in a React application?
There is a single-page application, on React, there are pages available only to authorized users, firstly, how to pull a login-password from the authorization page, transfer it through props?
Or in somewhere separately to store the data? what do you advise?)
Answer the question
In order to leave comments, you need to log in
The password cannot be stored on the client, during authorization you send a login and password - in response you receive a token, save it to cookies, for example, now with each request a token will be sent to the server and if it is valid, the user will be returned.
give private content only for requests with a token,
read about JWT
Passport to help you
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question