Fix: blank profile page - implement UserProfile component and REST endpoint#34
Open
ImranFarhat01 wants to merge 1 commit into
Open
Fix: blank profile page - implement UserProfile component and REST endpoint#34ImranFarhat01 wants to merge 1 commit into
ImranFarhat01 wants to merge 1 commit into
Conversation
…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
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.
Problem
/dashboard/profileroute existed in the router but had no component assigned — the page was completely blanklast_loginwas never updated on login because the custom token auth view did not call Django'slogin(), so it always showed nullFix
UserProfileReact component with avatar, schematic/simulation stats, view mode, edit mode, and change password dialogUserProfileSerializerexposingid,username,email,first_name,last_name,date_joined,last_loginUserProfileUpdateSerializerfor PATCH requests (editable fields only)UserProfileViewREST endpoint at/api/auth/user/profile//dashboard/profileroute toUserProfilecomponentautoComplete="new-password"to password fields to prevent browser autofilldate_joinedafter editinglast_loginon token auth to reflect actual login timeTesting
date_joinedis preserved after save