Skip to content

feat: add User Profile page, Google OAuth fix, MongoDB Atlas support#222

Open
MohanVamsi237 wants to merge 1 commit into
KENZY004:mainfrom
MohanVamsi237:profileSection
Open

feat: add User Profile page, Google OAuth fix, MongoDB Atlas support#222
MohanVamsi237 wants to merge 1 commit into
KENZY004:mainfrom
MohanVamsi237:profileSection

Conversation

@MohanVamsi237

Copy link
Copy Markdown

Description

This PR implements the User Profile feature and fixes Google OAuth authentication in the EduBoard application.

Changes

  1. User Profile Component:
    • Created a dedicated User Profile page at /profile supporting full profile field management (Bio, Phone Number, Educational Institution, Course/Department, Full Name, and Profile Picture).
    • Added support for local profile picture uploads (falling back to local storage if Cloudinary is not configured).
    • Integrated the profile section into Dashboard navigation.
  2. Google Authentication Flow:
    • Fixed initialization and stale closure bug in Login.jsx and Signup.jsx by using useRef and useCallback to ensure callbacks always obtain the latest handlers.
    • Added client-side client ID validation.
    • Safely escaped the user's email regex on the backend to avoid Regex Injection vulnerabilities or parsing issues.
  3. Database Configuration:
    • Configured MongoDB Atlas compatibility for local/deployed server runs.

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

@MohanVamsi237 is attempting to deploy a commit to the MINHA's projects Team on Vercel.

A member of the Team first needs to authorize it.

@KENZY004

Copy link
Copy Markdown
Owner

Hey @MohanVamsi237, thanks for the PR. There are several issues and security risks that need to be addressed before this can be merged:

  1. 🔴 User upload file committed to Git The file server/public/uploads/profile-1784217610534-image.png was checked into the repository. User uploads should never be tracked by Git. Please delete this file from the PR and ensure the uploads directory is ignored in .gitignore.

  2. 🔴 Security risk: Path traversal in file upload In server/routes/auth.js, the filename generator attempts to sanitize file.originalname. Relying on user-supplied filenames is unsafe. Please generate a random name (e.g., using a UUID) rather than sanitizing the original file name:

  3. 🟠 Missing pointer cursor on Dashboard profile icon The profile avatar button in the Dashboard header does not show a pointer cursor on hover. Please add cursor-pointer to the class list of that button in Dashboard.jsx.

  4. 🟠 Replace placeholder values in Profile form The placeholders currently use generic mock values (like "John Doe", "Stanford University", "Computer Science") which make the UI look like a template. Please update them to standard, action-oriented placeholders in Profile.jsx:
    Full Name: "Enter your full name"
    Educational Institution: "Enter your school or college"
    Course / Department: "Enter your course or department"

  5. 🟡 Profile sync request frequency In Dashboard.jsx, the profile API syncs on mount every time the dashboard is loaded. This should be optimized later to avoid redundant requests when local storage profile data is already populated.

Please fix these issues and push the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants