Appearance
Profile
File Information
- Path:
pages/profile.vue - Route:
/profile - Purpose: User profile management and account settings
Overview
The Profile page allows authenticated users to view and manage their personal profile information, including name, email, password, preferences, and account settings.
Key Features
Profile Information
- Display user name and email
- Profile picture upload
- Personal information editing
- Account details
Password Management
- Change password
- Password strength validation
- Password confirmation
- Security settings
Preferences
- Notification preferences
- Email preferences
- Display preferences
- Language settings
Account Settings
- Account status
- Email verification status
- Two-factor authentication
- Account deletion
Components Used
- Profile form components
- Password change components
- Preference settings components
- Avatar upload components
Data Properties
javascript
{
user: null, // Current user object
loading: false, // Loading state
saving: false, // Saving state
profileForm: { // Profile form data
name: '',
email: '',
phone: '',
avatar: null
},
passwordForm: { // Password form data
current_password: '',
new_password: '',
confirm_password: ''
}
}Computed Properties
currentUser
Returns current authenticated user
isEmailVerified
Checks if email is verified
canChangePassword
Checks if user can change password
Methods
loadProfile()
Loads user profile:
- Fetches user data from API
- Updates form data
- Handles errors
saveProfile()
Saves profile changes:
- Validates form data
- Updates profile via API
- Refreshes user data
- Shows success message
changePassword()
Changes password:
- Validates password form
- Validates password strength
- Updates password via API
- Shows success message
- Clears form
uploadAvatar(file)
Uploads profile picture:
- Uploads avatar file
- Updates profile picture URL
- Handles upload errors
API Endpoints
Get User Profile
- Endpoint:
GET /user/profile - Response: User profile object
Update Profile
- Endpoint:
PUT /user/profile/update - Request Body: Profile update data
- Response: Updated profile object
Change Password
- Endpoint:
POST /user/change-password - Request Body: Password change data
- Response: Success confirmation
Upload Avatar
- Endpoint:
POST /user/upload-avatar - Request: FormData with avatar file
- Response: Avatar URL
User Flow
- User navigates to profile page
- Page loads user profile data
- User views profile information
- User edits profile details
- User changes password (if needed)
- User uploads avatar (if needed)
- Changes are saved
- Success message displayed
Notes for Development
- Page requires authentication
- Profile changes update immediately
- Password change requires current password
- Avatar upload uses FormData
- Email verification status displayed
Related Documentation
- Authentication Pages - Login and authentication
- Workspace Settings - Workspace management