Resolves #4, #6, #9, #11, #26, #166 — Core Security, Validation & UI Enhancements - #333
Open
shouryapratap132006 wants to merge 6 commits into
Open
Conversation
…size limit - Add MIME type allowlist (images, pdf, doc/docx, xls/xlsx, txt) - Add file extension allowlist validated alongside MIME type - Add 10 MB file size limit via multer limits config - Add Express error handler on submission route to return clean 400 for MulterError (size) and fileFilter rejections (bad type) - Executables (.exe, .sh, .bat, .php, .js, etc.) are now rejected
- Server: return 400 with clear message when title is missing/empty - Model: add required:true + trim to title field; add 'Open' default status - Client: inline error state on CreateTaskModal when title is blank; red border + error message cleared as user types; aria attributes added
- Add server/config/tokenBlocklist.js: in-memory Set for invalidated JWTs - Add POST /api/auth/logout route (requires valid token via protect) - logoutUser controller adds current token to blocklist - protect middleware rejects blocklisted tokens with 401 - AuthContext.logout() now awaits POST /api/auth/logout before clearing localStorage, so captured tokens are server-side invalidated - Sidebar and TalentSidebar await async logout before navigating - Token expiry shortened from 7d to 1d (reduces blocklist retention)
- Extend search scope to include task description (was title + assignee only) - Add 'Clear filters' (x Clear) button that appears when any filter is active - Add unique ids to search input and status select for testability - TasksTable shows context-aware empty state: distinguishes between 'no tasks exist' vs 'no tasks match current filters'
TaskCard.jsx: - Proper date formatting using toLocaleDateString - Urgency chips: 'Overdue', 'Due today', 'Due tomorrow', 'X days left' with color coding (red/amber/neutral) - Description line-clamp to 2 lines to keep cards uniform - Subtle hover box-shadow effect - Unique id on Claim button for testability AvailableTasksList.jsx: - Search bar filtering by title and description with useMemo - Live counter showing matched / total count - 'Clear' button when search is active - Context-aware empty states: no tasks vs no matches - Icon in empty state changes between search and default
- New ConfirmDialog component: reusable modal with title, warning icon, message, Cancel and configurable confirm button (danger/warning variants) - TasksTable: delete task button now opens ConfirmDialog showing the task title; API call only fires after explicit user confirmation - SubmissionReviewModal: Reject button opens ConfirmDialog showing talent name; Approve remains immediate (non-destructive, no confirm needed) - Both destructive buttons given unique ids for testability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4, Closes #6, Closes #9, Closes #11, Closes #26, Closes #166
Summary of Changes
Issue #4 — [Security] Unrestricted File Uploads Accept Executable Files
400 Bad Requestresponses on upload errors or invalid file types/executables.Issue #9 — [Bug] Task Creation API Allows Empty Payloads
createTaskreturning400 Bad Requestwhentitleis missing or empty whitespace.Taskschema withrequired: true,trim: true, and defaultstatus: 'Open'.CreateTaskModal.Issue #6 — [Security] Lack of Server-Side Session Invalidation Upon Logout
tokenBlocklist.js).POST /api/auth/logoutendpoint to add invalidated JWTs to the blocklist.protectmiddleware to check blocklist and reject invalidated tokens with401 Unauthorized.AuthContext.logout()to call the server-side logout before clearing storage.Issue #11 — [Feature] Add Search and Status Filtering to Admin Task List
AdminDashboardto cover title, description, and assigned talent name.TasksTable.Issue #166 — Available Tasks Discovery Redesign
AvailableTasksListwith search filtering (title/description), live task counters, and improved empty states.TaskCardwith date formatting, color-coded urgency badges ("Overdue", "Due today", "Due tomorrow", "Xd left"), and hover animations.Issue #26 — [UX] Missing Confirmation Dialogs for Destructive Action
ConfirmDialogmodal component.TasksTableand rejecting submissions inSubmissionReviewModal.