issues
search
changmeng72
/
chatApp
MIT License
0
stars
0
forks
source link
Back-end: Signup / Login API Routes
#4
Open
skassam21
opened
3 years ago
skassam21
commented
3 years ago
Create a Register route (POST)
this will create a new user, return 201
validation on the back-end - password should be atleast 6 characters, required fields (email, name)
simple password validation (>6 chars)
Create a Login route (POST)
verify username and password
return 4xx if things are incorrect
User model, don't want to save password directly on the database (hash/salt before we save them)
Add an auth middleware / decorator - we can easily create authenticated routes and get the user object
Try to use a decent authentication strategy something like using HTTP only cookies or localstorage