mern-video-streaming icon indicating copy to clipboard operation
mern-video-streaming copied to clipboard

user authentication

Open aninda052 opened this issue 1 year ago • 0 comments

This pr will close #35

server

  • user login and registration api added
  • hash password before storing in db using bcrypt package
  • add JWT based authentication system using jsonwebtoken package
  • setCurrentUser middleware is used for binding current user with request
  • loginRequired middleware will used for protected route
  • made /api/videos/update, /api/videos/delete and /api/videos/upload as protected route
  • store jwt token in cookies with httpOnly=true

client

  • integrate login and registration api
  • implement protected route
  • showing alert using global context & state
  • redirect anonymous user to login page and navigate them to their desire page after successful login.
  • after successful login, store user info in local storage

aninda052 avatar Aug 30 '23 16:08 aninda052