This is an example of auth with react-redux and JWT tokens, it uses MongoDB for storing user info's, and leverage the browser's local storage for state persistence across page refresh. For protected paths or skip path, i have created custom react-router 4 components using the provided api.

Requirement:

1. install and run MongoDB
2. terminal

Steps:

1. git clone https://github.com/cristeaandrei95/react-redux-auth.git
2. cd react-redux-auth/server && npm install && npm start // -> this is the server it, runs on port 3000, let it run in background.
3. cd react-redux-auth/client && npm install && npm start // -> this is the client, the app will run on port 3001.
4. navigate to: http://localhost:3001/signup & create an account

available pages:

  1. /login
  2. /signup
  3. /