Skip to content

User Profile ## Business Purpose Allow authenticated users to view and update their personal information, change their password, and delete their account. ## Current Behaviors - View Profile: The UserInformation component displays the user's name, email, and other fields; data is fetched from the API UserInformation.tsx:47.

  • Update Profile: Users can edit their name and email; changes are saved via updateUserMe API UserInformation.tsx:52.
  • Change Password: The ChangePassword component validates the current password and updates it via updatePasswordMe ChangePassword.tsx:34.
  • Delete Account: A two-step confirmation dialog (DeleteConfirmation) allows permanent deletion (DeleteAccount.tsx:3, DeleteConfirmation.tsx:21-39).
  • Backend Routes: update_user_me, update_password_me, delete_user_me in users.py users.py:82. ## Technical Implementation - Frontend Components: UserInformation.tsx:47-78 (form and data display), ChangePassword.tsx:34-64 (password form), DeleteConfirmation.tsx:21-39 (modal).
  • API SDK: updateUserMe, updatePasswordMe, deleteUserMe (sdk.gen.ts:316-355, 301).
  • Backend Logic: CRUD operations via crud.py:10-45 for user updates and authentication.
  • Security: Password change requires current password verification before setting new hash users.py:104.
  • Testing: user-settings.spec.ts covers profile update, password change, and account deletion flow. ## Definition of Done - Profile information loads correctly from the API and displays in the form user-settings.spec.ts:17.
  • Updating name and email persists after refresh user-settings.spec.ts:54.
  • Password change succeeds with correct current password and shows success toast user-settings.spec.ts:109.
  • Password change fails with incorrect current password and shows error user-settings.spec.ts:163.
  • Account deletion shows confirmation dialog and physically deletes the user after confirmation user-settings.spec.ts:237.