COSC481W-2022Winter / capstone-hackmcx

capstone-hackmcx created by GitHub Classroom
0 stars 1 forks source link

feat: Add password & PUT endpoint to Users #90

Closed zxkevin closed 2 years ago

zxkevin commented 2 years ago

Added new migrations to update Users table with password column Seed file added to update pre-existing seeds with a password. POST endpoint for Users now requires a password. PUT endpoint for {userID} added for update users functionality. Bcrypt is used to salt and hash password for secure password storage.

87 #51

acampb65 commented 2 years ago

PUT user responds with 201 even if username doesn't exist.

example:

curl -X PUT -i http://localhost:3003/api/v1/users/nonExistentUsername \
-H 'Content-Type: application/json' \
-d '{"username":"user","password":"pass","firstname":"first","lastname":"last"}'

HTTP/1.1 201 Created
X-Powered-By: Express
Access-Control-Allow-Origin: *
Location: /api/v1/users/undefined
Date: Wed, 30 Mar 2022 18:11:43 GMT
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 0