/Express-react-auth-template

⚛️🔑 Simple login and register form using Express, React, jwt and cookies. Users can register, login, and access the protected route only after successful authentication.

Primary LanguageJavaScript

⚛️🔑 Express-React authentication template

node express mongodb jsonwebtokens react

Simple login and register form using Express, React and JWT. Users can register, login, and access the protected route only after successful authentication. The JWT token is used for authentication and is stored as a cookie in the client's browser. When the user logs out, the token is cleared from the cookie.

💿 Test the app locally

Replace the user, password and jwt_secret variables at .env inside the server folder with yours. In the project directory, you can run:

  • cd server
  • npm install
  • npm start
  • cd ../client
  • npm install
  • npm start

Open http://localhost:3000 to view it in your browser.

📷 Screenshots

demo demo demo demo