This pull request includes several enhancements to improve the security, reliability, and functionality of the application. The changes are as follows:
UserModel
Added password hashing before storing in the database.
Implemented checks for duplicate users, valid email addresses, and complexity requirements for usernames and passwords.
LoginController
Added error handling for the case when the get_user_by_username function fails.
Handled the case when multiple users with the same username exist in the database.
Implemented session management to keep the user logged in after successful login.
Added logging of unsuccessful login attempts.
PackageController
Added error handling for the case when the update_status function fails.
Implemented checks to ensure the consignment with the given id exists before updating its status.
Validated the given status before updating the consignment status.
Added logging of the status update.
ReportController
Added error handling for the case when the get_logs and get_consignments functions fail.
Implemented checks to ensure the user has the necessary permissions to view the logs and consignments.
Database Schema
Updated the users table to hash passwords before storing them.
Updated the consignments table to use an ENUM type for the status field.
Added a foreign key constraint to the user_id field in the logs table.
Updated the timestamp field to reflect the last update time when a row is updated.
Added indexes to the tables for performance, depending on the queries that will be run against these tables.
Summary
This pull request enhances the application's security, reliability, and functionality by implementing password hashing, duplicate user checking, email validation, complexity requirements enforcement, error handling, session management, unsuccessful login attempt logging, consignment existence checking, status validation, status update logging, user permission checking, and database schema updates. These changes ensure a more robust and secure application, providing a better user experience.
Fixes #12.
To checkout this PR branch, run the following command in your terminal:
git checkout {pull_request.branch_name}
🎉 Latest improvements to Sweep:
Use Sweep Map to break large issues into smaller sub-issues, perfect for large tasks like "Sweep (map): migrate from React class components to function components"
Getting Sweep to format before committing! Check out Sweep Sandbox Configs to set it up.
We released a demo of our chunker, where you can find the corresponding blog and code.
💡 To get Sweep to edit this pull request, you can:
Leave a comment below to get Sweep to edit the entire PR
Leave a comment in the code will only modify the file
Edit the original issue to get Sweep to recreate the PR from scratch
Description
This pull request includes several enhancements to improve the security, reliability, and functionality of the application. The changes are as follows:
UserModel
LoginController
PackageController
ReportController
Database Schema
Summary
This pull request enhances the application's security, reliability, and functionality by implementing password hashing, duplicate user checking, email validation, complexity requirements enforcement, error handling, session management, unsuccessful login attempt logging, consignment existence checking, status validation, status update logging, user permission checking, and database schema updates. These changes ensure a more robust and secure application, providing a better user experience.
Fixes #12.
To checkout this PR branch, run the following command in your terminal:
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: