This pull request introduces functionality for users to create and retrieve their own profiles. It adds new routes for profile management and integrates these routes with the existing authentication system to ensure that profile actions are secure and user-specific.
Summary
Added a new route file routes/profile.routes.js for handling profile-related requests.
Updated app.js to include the new profile routes and ensure they are protected by the authentication middleware.
Implemented GET /profile and PUT /profile endpoints within profile.routes.js to allow users to retrieve and update their profile information, respectively. These endpoints are secured with the authenticateToken middleware.
Added password hashing with bcrypt for the PUT /profile endpoint to securely update user passwords.
Created a new test file test/profile.test.js to cover the new profile functionality, including tests for successful profile retrieval and update, handling unauthorized access, and validating input data.
Ensured that sensitive information like passwords is not included in the response of the GET /profile endpoint.
Fixes #90.
🎉 Latest improvements to Sweep:
New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
PR Feedback (click)
Description
This pull request introduces functionality for users to create and retrieve their own profiles. It adds new routes for profile management and integrates these routes with the existing authentication system to ensure that profile actions are secure and user-specific.
Summary
routes/profile.routes.js
for handling profile-related requests.app.js
to include the new profile routes and ensure they are protected by the authentication middleware.GET /profile
andPUT /profile
endpoints withinprofile.routes.js
to allow users to retrieve and update their profile information, respectively. These endpoints are secured with theauthenticateToken
middleware.bcrypt
for thePUT /profile
endpoint to securely update user passwords.test/profile.test.js
to cover the new profile functionality, including tests for successful profile retrieval and update, handling unauthorized access, and validating input data.GET /profile
endpoint.Fixes #90.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can:
This is an automated message generated by Sweep AI.