Skip to content

Fix: blank profile page - implement UserProfile component and REST endpoint#34

Open
ImranFarhat01 wants to merge 1 commit into
FOSSEE:developfrom
ImranFarhat01:fix/profile-page-clean
Open

Fix: blank profile page - implement UserProfile component and REST endpoint#34
ImranFarhat01 wants to merge 1 commit into
FOSSEE:developfrom
ImranFarhat01:fix/profile-page-clean

Conversation

@ImranFarhat01

Copy link
Copy Markdown

Problem

  • /dashboard/profile route existed in the router but had no component assigned — the page was completely blank
  • last_login was never updated on login because the custom token auth view did not call Django's login(), so it always showed null

Fix

  • Created UserProfile React component with avatar, schematic/simulation stats, view mode, edit mode, and change password dialog
  • Added UserProfileSerializer exposing id, username, email, first_name, last_name, date_joined, last_login
  • Added UserProfileUpdateSerializer for PATCH requests (editable fields only)
  • Added UserProfileView REST endpoint at /api/auth/user/profile/
  • Wired /dashboard/profile route to UserProfile component
  • Added autoComplete="new-password" to password fields to prevent browser autofill
  • Merged PATCH response into existing profile state to preserve read-only fields like date_joined after editing
  • Updated last_login on token auth to reflect actual login time

Testing

  • Profile page loads with correct user data (username, email, member since, last login, schematic count)
  • Edit profile updates fields and shows success toast; date_joined is preserved after save
  • Change password dialog opens with empty fields (no autofill)
  • Last login updates correctly after each login

…endpoint

Problem:
- /dashboard/profile route had no component assigned, page was blank
- last_login was never updated on login, always showing null

Fix:
- Create UserProfile React component with avatar, stats, edit mode,
  and change password dialog
- Add UserProfileSerializer exposing id, username, email, first_name,
  last_name, date_joined, last_login
- Add UserProfileUpdateSerializer for PATCH requests
- Add UserProfileView REST endpoint at /api/auth/user/profile/
- Wire /dashboard/profile route to UserProfile component
- Add autoComplete=new-password to password fields to prevent autofill
- Merge PATCH response into existing profile state to preserve read-only
  fields like date_joined after editing
- Update last_login on token auth to reflect actual login time
@ImranFarhat01 ImranFarhat01 changed the title Fix: blank profile page — implement UserProfile component and REST endpoint Fix: blank profile page - implement UserProfile component and REST endpoint Jun 20, 2026
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.

1 participant