mern-video-streaming
mern-video-streaming copied to clipboard
user authentication
This pr will close #35
server
- user
login
andregistration
api added - hash password before storing in db using
bcrypt
package - add
JWT
basedauthentication
system usingjsonwebtoken
package -
setCurrentUser
middleware is used for bindingcurrent user
withrequest
-
loginRequired
middleware will used forprotected route
- made
/api/videos/update
,/api/videos/delete
and/api/videos/upload
as protected route - store jwt
token
in cookies withhttpOnly=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