feat: update authentication and profile management features
- Enhanced login response to include additional user information such as email, tier, and role. - Updated profile update logic to restrict access based on user roles and ensure only authorized users can modify profiles. - Replaced ProfilePage with AccountSettingsPage in routing and updated related components to reflect this change. - Added new API functions for updating profiles and changing passwords to improve user account management.
This commit is contained in:
1 parent
d9d2d9e506
commit
fae673670a
10 files changed
+283
-73
No files matched your search
@@ -93,6 +93,20 @@ export async function getCurrentProfile() {
|
||||
return request('/api/profiles/me')
|
||||
}
|
||||
|
||||
export async function updateProfile(profileId, data) {
|
||||
return request(`/api/profiles/${profileId}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(data),
|
||||
})
|
||||
}
|
||||
|
||||
export async function changePassword(newPassword) {
|
||||
return request('/api/auth/pin', {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ pin: newPassword }),
|
||||
})
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Clubs & Groups
|
||||
// ============================================================================
|
||||
@@ -865,6 +879,8 @@ export const api = {
|
||||
register,
|
||||
logout,
|
||||
getCurrentProfile,
|
||||
updateProfile,
|
||||
changePassword,
|
||||
|
||||
// Clubs & Groups
|
||||
listClubs,
|
||||
|
||||
Reference in new issue
Block a user