Add CSRF protections to state-changing endpoints

This commit is contained in:
Ryan
2025-03-18 11:46:23 -04:00
committed by GitHub
parent f709c23bcc
commit d23cefa8a9
23 changed files with 239 additions and 79 deletions

View File

@@ -27,6 +27,7 @@ Multi File Upload Editor is a lightweight, secure web application for uploading,
- The file list can be sorted by name, last modified date, upload date, size, or uploader. For easier browsing, the interface supports pagination with selectable page sizes (10, 20, 50, or 100 items per page) and navigation controls (“Prev”, “Next”, specific page numbers).
- **User Authentication & Management:**
- Secure, session-based authentication protects the editor. An admin user can add or remove users through the interface. Passwords are hashed using PHPs password_hash() for security, and session checks prevent unauthorized access to backend endpoints.
- **CSRF Protection:** All state-changing endpoints (such as those for folder and file operations) include CSRF token validation to ensure that only legitimate requests from authenticated users are processed.
- **Responsive, Dynamic & Persistent UI:**
- The interface is mobile-friendly and adjusts to different screen sizes (hiding non-critical columns on small devices to avoid clutter). Updates to the file list, folder tree, and upload progress happen asynchronously (via Fetch API and XMLHttpRequest), so the page never needs to fully reload. Users receive immediate feedback through toast notifications and modal dialogs for actions like confirmations and error messages, creating a smooth user experience. Persistent UI elements Items Per Page, Dark/Light Mode, folder tree view & last open folder.
- **Dark Mode/Light Mode**