Search posts, tags, users, and pages
Checkout JWT authentication with React and Redux or you can use this package. Both of them seem to have good documentation.
@prank7 any plans to add this in future for mern?
Thanks a lot. Currently I successfully applied this approach to authenticate user access within one route, and it so far gives me what I want. Nevertheless, I wonder if the approach of this repo is possible? It provides route based authentication that is more useful for large projects. Thanks~
Prashant, none of the examples around show how to use JWT with passport-facebook All of the examples I've seen around stop at passport-local or your own email/password. None go the extra mile to demonstrate how to implement 3rd party Oauth like facebook or twitter using JWT. I don't need to tell you that Facebook and other social connect buttons are the standard since they are implemented on Hashnode as well. but somehow they are always overlooked and nobody ever demos how to implement JWT with a Facebook strategy. No one! This is extremely important and essential and all answers avoid this point. why? Why won't you demo how to implement a social connect with JWT using Mern? This is not Trivial. not at all. Please consider to. Thank you.
I found this authentication example which applies redux-router approach. github.com/joshgeller/react-redux-jwt-auth-example
And this blog really helped me understand what's going on. blog.slatepeak.com/build-a-react-redux-app-with-j…
Basically, it wrapped protected components into a higher order component (let's call it HOC). HOC decides whether the protected components are going to be rendered depending on the authentication status in the states.
However, I still run into some issue. HOC detects authentication status using componentWillReceiveProps. My componentWillReceiveProps just can't detect any prop changes. Did anyone run into the same issue?