Populate Next.js UserProfile fields from users/me/meta schema - #83
Merged
Merged
Conversation
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ 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 |
janithjay
force-pushed
the
fix-nextjs-users-me-meta
branch
from
August 17, 2026 18:56
54a1b17 to
1425c4c
Compare
janithjay
marked this pull request as ready for review
August 17, 2026 18:56
Signed-off-by: janithjay <janithjayashan018@gmail.com>
janithjay
force-pushed
the
fix-nextjs-users-me-meta
branch
from
August 18, 2026 05:09
1425c4c to
45b808f
Compare
brionmario
approved these changes
Aug 18, 2026
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
<UserProfile>component in@thunderid/nextjsdidn't receives auserSchema, so it always renders throughBaseUserProfile's schema-less fallback path. Raw flattened profile keys were used with generic,startCasederived labels (Ou Id,Family Name,Sub) instead of the schema's configured display names, and no required/regex validation on edit.Approach
Traced the gap through the full data path and found
userSchemawas dropped at three separate points, so all three needed fixing together,ThunderIDServerProvider(server/ThunderIDProvider.tsx) callsgetUserAction(ID token claims) andgetUserProfileAction(getUsersMe), but nothing ever callsgetUsersMeMeta. AddedThunderIDNextClient.getUserSchema()and a newserver/actions/getUserSchemaAction.tsserver action, called alongside the existing two under the sameshouldFetchUserProfilegate.The client-side provider (
client/contexts/ThunderID/ThunderIDProvider.tsx) haduserSchema: nullhardcoded in its context value, and never received the schema as a prop in the first place. Added auserSchemaprop, synced into state the same wayuserProfilealready is, and passed it into<UserProvider userSchema={userSchema}>. The actual contextuseUser()reads from, which the hardcoded value never reached regardless.client/components/presentation/UserProfile/UserProfile.tsxonly destructured{profile, flattenedProfile, onUpdateProfile, updateProfile}fromuseUser(), omittinguserSchemaentirely, and never passed it to<BaseUserProfile>. Even with the schema correctly available upstream, this component would still never have rendered it. Fixed to read and passuserSchemathrough.After Fix
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks