Commit Graph
13 Commits
Author SHA1 Message Date
whoswhip bea106ac72 Finish converting all apis to controllers, static endpoints next. 2025-07-09 14:50:59 -04:00
whoswhip fddfeb6525 Improve AES encryption with dynamic salt handling
Updated `encryptAES` to use a randomly generated salt and
modified the return value to include the salt, IV, and
encrypted content in a single output. Adjusted `decryptAES`
to extract the salt and IV from the input, ensuring the
decryption key is derived using the same salt used during
encryption. Enhanced decryption process to utilize the
extracted IV for AES-GCM operations.
2025-07-09 01:07:18 -04:00
whoswhip ed98238c40 Improve paste handling and pagination logic
- Updated `PasteController.cs` to enhance visibility parameter handling and added methods for retrieving pastes with pagination and error handling.
- Added `UID` property to the `Paste` class for better identification.
- Refactored `Program.cs` to remove unused namespaces and improve response header handling.
- Enhanced `DatabaseService.cs` with new methods for retrieving pastes and user pastes, including better error handling.
- Adjusted pagination logic in `archive.js` and `dash.js` to start from page 1, improving user interface navigation.
2025-07-08 15:32:17 -04:00
whoswhip 181c401af7 Convert more apis to controllers
- pastes/id/info
- pastes/id
- pastes/id/views
2025-07-07 18:18:06 -04:00
whoswhip 3eb7374a07 Enhance user authentication and paste management
- Updated `AuthController.cs` to include token in `CreateSession` and improved validation for username and email.
- Refactored paste creation logic from `Program.cs` to a new `PasteController.cs`.
- Added email validation method in `HelperService.cs`.
- Introduced `CompressionService.cs` for handling string compression and decompression.
- Improved user experience with autocomplete and spellcheck in HTML forms.
- Enhanced date display in `archive.js` and refactored date formatting in `dash.js`.
- Updated API endpoints in `login.js` and `register.js` to reflect changes.
2025-07-06 22:55:29 -04:00
whoswhip cc0c6a8286 refactor(api): migrate account deletion from minimal API to controller 2025-07-06 19:33:19 -04:00
whoswhip 73ac667c15 Merge branch 'sharpbinV2' of https://github.com/whoswhip/sharpbin into sharpbinV2 2025-07-06 18:59:48 -04:00
whoswhip 89e9673a00 Convert more authentication apis to controllers and session management
- Updated `AuthController.cs` to change unauthenticated response to `Unauthorized` and added a new `Logout` method for session handling.
- Removed the old logout endpoint in `Program.cs` and centralized logout logic in `AuthController.cs`.
- Added `GetSession` and `DeleteSession` methods in `DatabaseService.cs` to enhance session management.
- Updated API endpoints in `dash.js` to reflect new routing structure for authorized account info and logout.
2025-07-06 18:59:39 -04:00
whoswhip 73248e723a Refactor authentication and database handling
- Introduced `AuthController` for user registration and login.
- Added `DatabaseService` to manage user-related database operations.
- Created `HelperService` for utility functions like JSON parsing and token generation.
- Updated `Program.cs` to register new services and controllers.
- Modified `login.js` and `register.js` to use new API endpoints.
- Cleaned up project file by removing unused class and ensuring proper compilation.
- Overall improvements enhance application structure, security, and functionality.
2025-07-06 18:17:54 -04:00
whoswhip e6e6bf9ee6 Merge branch 'sharpbinV2' of https://github.com/whoswhip/sharpbin into sharpbinV2 2025-07-06 15:25:03 -04:00
whoswhip a338b8814a Prepare for switch to controllers & remove hmac hashing, switch to bcrypt instead. 2025-07-06 15:24:56 -04:00
whoswhip 1881c8a90d Merge branch 'sharpbinV2' of https://github.com/whoswhip/sharpbin into sharpbinV2 2025-06-29 10:29:46 -04:00
whoswhip 38411ca7c0 Add password reset functionality(WIP): implement PasswordReset class, database methods for password reset, and update routes for password reset handling. Enhance UI with new success message styles and update login page with reset password link. 2025-06-29 10:29:37 -04:00