Description:
The UserProvider currently identifies the currentUser by fetching all users from /api/users and matching the email received from the native bridge. With the implementation of the /api/users/me endpoint, this process should be refactored.
Requirements:
- Add a
getMe() method to userApi in features/user/api.ts.
- Update the
fetchUsers logic in features/user/context.tsx to:
- Call
userApi.getMe() instead of userApi.getUsers() for initial identification.
- Assign the result directly to the
currentUser state.
- Remove the "brute-force" email matching logic associated with the global user list.
Success Criteria:
Description:
The
UserProvidercurrently identifies thecurrentUserby fetching all users from/api/usersand matching the email received from the native bridge. With the implementation of the/api/users/meendpoint, this process should be refactored.Requirements:
getMe()method touserApiinfeatures/user/api.ts.fetchUserslogic infeatures/user/context.tsxto:userApi.getMe()instead ofuserApi.getUsers()for initial identification.currentUserstate.Success Criteria:
/api/usersfetch.currentUseris populated accurately upon login or app refresh.