-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Description
Currently, ChatService.getUserChatSessions hardcodes a placeholder avatar from pravatar.cc:
.avatarUrl("[https://i.pravatar.cc/150?u=](https://i.pravatar.cc/150?u=)" + sessionId)This should be replaced with a real avatar system. A simple first step would be to use the user's Google profile picture (if they signed in with Google) or a generated "identicon" for email/password users.
Acceptance Criteria
- Modify
User.java: Add a newprivate String avatarUrl;field. - Modify
AuthService.handleGoogleOAuth: When validating theid_token, extract thepictureclaim from the Google token info response. Save this URL to theavatarUrlfield on the newUseror existingUser. - Modify
AuthService.signUp: For users signing up with email/password, generate a default avatar (e.g., using a service likehttps://www.gravatar.com/avatar/{hash_of_email}or a local identicon library) and save it to theavatarUrlfield. - Modify
ChatService.getUserChatSessions: This method is for anonymous sessions. The avatar should be for the anonymous user. Thepravatar.cclink based onsessionIdis actually a good, simple solution for anonymous users. The issue is that registered users also need avatars. - Refinement: The
Usermodel needs anavatarUrl. TheChatSessionDtoavatarUrlshould remain the anonymous user's avatar. A new feature is needed to get the registered user's avatar (e.g., on the/api/auth/meresponse). - Updated AC:
-
- Add
avatarUrltoUser.java.
- Add
-
- Populate
avatarUrlinAuthService.handleGoogleOAuthfrom thepictureclaim.
- Populate
-
- Populate
avatarUrlinAuthService.signUpwith a Gravatar link (e.g.,https://www.gravatar.com/avatar/HASH?d=identicon).
- Populate
-
- Ensure the
Userobject returned by/api/auth/me,/api/auth/login, etc., includes this newavatarUrlfield.
- Ensure the
-