Feature/auth security route protection refactor#384
Conversation
|
Someone is attempting to deploy a commit to the anubhav12302387's projects Team on Vercel. A member of the Team first needs to authorize it. |
❌ PR Format Check — Failed — Please Fix BelowHi @saidai-bhuvanesh! Please fix the issues below before your PR can proceed to mentor review. ❌ Must Fix Before Proceeding❌ Title format invalid — Use Conventional Commits format
❌ Issue #383 is not assigned to you (@saidai-bhuvanesh) — You must be assigned to the issue before submitting a PR.
📋 EventOne PR Guidelines (click to expand)Title format — Conventional Commits: Always link an issue: Use a feature branch — never PR directly from Write your own description — AI-generated content = EventOne × GSSoC Pipeline — Stage 1 Automated Check |
👋 Thanks for opening a PR, @saidai-bhuvanesh!Your PR has entered the 🎯 EventOne GSSoC PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. EventOne × GSSoC Automated Pipeline |
closes 383
📝 Description
[This PR delivers high-impact full-stack improvements across two primary areas:](feat: improve authentication security and route protection workflows)
This PR delivers high-impact full-stack improvements across two primary areas:
🔗 Related Issue
Closes #383
🛠️ Key Changes
1. Realtime & Performance Optimizations (Phase 1)
server.jsand fixed the nesting syntax bug insocket.js.OrganizerDashboard.jsxto prevent full-page re-renders during text input.cancelRegistrationinsideregistrationController.jsto automatically and atomically promote waitlisted users and update counts on Socket.IO when a booking is cancelled.2. Authentication & Route Security Refactor (Phase 2)
authenticatemiddleware in auth.js to query the database and verify user active status (isBlocked). If a user is blocked, they are immediately cut off from API access.eventValidation), reviews (reviewValidation), and co-organizers (coOrganizerValidation) in validationMiddleware.js. Normalized validation failures to output{ success: false, message: 'Validation failed', errors: [...] }.AppErrorwrapper in errors.js and updated the global error handler in app.js to return unified JSON error bodies.fetchUserin AuthContext.jsx to retain active user credentials on general network/fetch failures, clearing sessions only on explicit401/403responses.🧪 How to Test
Backend Testing (Jest Suites)
Run the automated test suites in the backend directory: