Enable self-service profile updates in Android SDKs - #26
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: janithjay <janithjayashan018@gmail.com>
janithjay
force-pushed
the
users-me-profile
branch
from
August 24, 2026 10:48
897c4a8 to
095cf60
Compare
11 tasks
brionmario
approved these changes
Aug 28, 2026
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Currently, the Android SDK's user profile view sources attributes from the
JWT/userinfoclaims embedded in the sign-in token, which is read-only and limited to whatever claims a given application's token happens to carry.This PR makes the profile view fetch from
GET /users/meby default, matching the JavaScript SDK, and adds,GET /users/me/meta(PUT /users/me).ThunderIDState.useracross sign-in/refresh.ThunderIDConfig.fetchUserProfile(defaulttrue), for apps that want the previous token-claims-only, read-only behavior instead.Approach
ThunderIDClient: fixedgetUserProfile()/addedgetUserSchema()to call the real/users/me//users/me/metaendpoints (previously pointed at nonexistent/scim2/*routes).updateUserProfile()now doesPUT /users/mewith{"attributes": {...}}, matching the backend's actual contract.UserProfile.kt: schema-driven field building (buildProfileFields), validation (validateField: required + regex, invalid regex ignored rather than blocking save), and a merge-before-save step (deepMergeAttributes) since the backend rejects a save missing any required attribute, even for a single-field edit.Token-only mode(fetchUserProfile = false) intentionally mirrors the Quickstart's pre-existinguserAttributes()/formatClaim()/claimLabel()behavior verbatim rather than reinventing it, now hoisted from the sample into the reusable SDK component.ThunderIDState: the/users/meprofile-picture sync is launched on theThunderIDProviderlevelCoroutineScoperather than awaited inline, since it's triggered from screens (e.g.SignIn) that unmount and cancel their own rememberCoroutineScope() right as the user signs in.ic_edit,ic_check,ic_close) hand-drawn to match the existing icon convention.After fix default method (
fetchUserProfile = true)After fix attributes fetch from
sign-in tokenmethod (fetchUserProfile = false)Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks