0
I have an api in Passport, in my front end that is in React I created a private route, in this private route I called a function checkAuth, to know the user ta authenticated, but for now I made this function by passing true or false to test, as a beginner, when I tried to check if the token is true or not, I ended up crashing, because I do not know how to do or where to start, I would need a practical example, if someone can help me, I appreciate!
Until the part of checking user and password, generate the token and store it in the location ta ok Torage. I just need to check if this token is true or has not been changed, thanks in advance!
Possible duplicate of React: Check user authenticated by front-end!
– Luiz Felipe