169-30-21-8-6-5-anurag-gupta - #345
Open
Anurag2618g wants to merge 6 commits into
Open
Conversation
…ggle animation and theme-responsive UI
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.
Summary
This Pull Request completes the six assigned qualification issues (#169, #30, #21, #8, #6, and #5). It implements a secure server-side logout mechanism, upgrades the submission flow to handle multiple files, resolves database consistency bugs during task deletion and review cascading, and delivers critical UI enhancements including premium dark mode and password visibility toggles. All changes have been tested locally and pass strict linting and build checks.
Checklist
cd client && npm run lint && npm run buildandcd server && npm run lint && npm run buildlocallyShort Demo Video (required)
https://drive.google.com/file/d/1XZgzJt-9Trqn5rKv3kfEV64U_wJyiwcW/view?usp=sharing
Required Checklist
Task & Workflow
master) was pulled immediately before opening this PRQuality & Safety
Issues Completed
Issue #169 - Premium Dark Mode Implementation
Problem
The application was hardcoded to a dark theme using inline styles and CSS variables, offering no light mode or system preference synchronization.
Implementation
@custom-variant dark).ThemeTogglecomponent that synchronizeslocalStorageand animates an SVG icon.<script>inindex.htmlbefore React hydrates to prevent theme flickering on initial load.Result
The application now supports a fully functional, persistent dark/light mode toggle accessible from every page.
Issue #30 - Password Fields Lack Visibility Toggle
Problem
Password inputs on Login and Register forms were hardcoded to
type="password", causing typos with no way to verify input.Implementation
showPasswordstate toggle to conditionally switch the input type betweentextandpassword.Result
Users can safely reveal and hide their passwords without accidentally submitting the forms.
Issue #21 - Modify Upload System to Support Multiple Files
Problem
The submission flow and database schema were strictly limited to a single file per submission.
Implementation
Submissionmodel to accept an array of strings (fileUrls).upload.single()toupload.array('files', 10).SubmitTaskModalto append multiple files to theFormDataobject using an array.Result
Talent users can now upload and submit multiple files simultaneously, which render correctly in the Admin review panel.
Issue #8 – Submission Review Status Not Cascading
Problem
Reviewing a submission updated only the submission document while the parent task remained in the previous state.
Implementation
Result
Task and submission status remain perfectly synchronized.
Issue #6 - Token Invalidation on Logout
Problem
Logout was strictly client-side. JWTs remained cryptographically valid on the server until expiration, leaving them vulnerable to replay attacks.
Implementation
BlockedTokenMongoose model with a MongoDB TTL (Time-To-Live) index to automatically purge documents at their natural expiry.logoutUsercontroller that upserts the active JWT into theBlockedTokencollection.protectauth middleware to checkBlockedToken.exists()and reject blacklisted tokens with a 401.Result
Logging out now actively invalidates the session token on the server-side, securing the API against captured token reuse.
Issue #5 – Task Deletion Leaves Orphaned Records
Problem
Deleting a task crashed the server or left related submission records orphaned in the database due to an invalid Mongoose query.
Implementation
deleteMany()to remove all associated submissions prior to deleting the parent task.Result
Prevents database bloating and orphaned records while ensuring successful API responses.
Files Changed
Backend
server/models/BlockedToken.js(new)server/models/Submission.jsserver/controllers/authController.jsserver/controllers/submissionController.jsserver/controllers/taskController.jsserver/middleware/authMiddleware.jsserver/routes/authRoutes.jsserver/routes/auth.js(new)server/routes/submissionRoutes.jsFrontend
client/index.htmlclient/src/index.cssclient/src/components/common/ThemeToggle.jsx(new)client/src/components/admin/Sidebar.jsxclient/src/components/admin/TasksTable.jsxclient/src/components/talent/TalentSidebar.jsxclient/src/components/talent/SubmitTaskModal.jsxclient/src/components/talent/SubmissionReviewModal.jsxclient/src/pages/auth/LoginPage.jsxclient/src/pages/auth/RegisterPage.jsxclient/src/pages/admin/AdminDashboard.jsxclient/src/pages/admin/SubmissionsPage.jsxclient/src/context/AuthContext.jsxScreenshots
Closes
Closes #169
Closes #30
Closes #21
Closes #8
Closes #6
Closes #5