Repository navigation
Send the current UI language as locale on embedded flow requests - #121
Thisara-Welmilla wants to merge 1 commit into
Conversation
🔀 Cross-SDK feature parityDoes this change need to ship in the other ThunderID SDKs too? This check stays red until one of these labels answers that:
Ports (DO NOT EDIT)
No sibling SDKs accounted for on this thread yet. Important Reply to this comment with this block, filled in. The boxes above tick A link can be a pull request or a tracked issue, written in full or as The contract is in the SDK development specification. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
Purpose
Makes the SDK carry the end user's current UI language with the flow, so the backend can render flow-driven notifications (email, SMS) in that language.
The SDK already knows the active language and builds every embedded flow-execute request, so it now attaches that language as a
localefield on each request it sends — flow initiation, step submission, social-login callback, and invite-token validation alike. The selected language therefore travels with the flow automatically: consuming apps don't have to thread it through each call, and no requests are missed.Approach
@thunderid/javascript): added an optionallocalefield to the embedded flow request bodies (EmbeddedSignInFlowRequest,EmbeddedSignUpFlowRequest,EmbeddedRecoveryFlowRequest). It is a first-class, documented field — mirroring thelanguageparameter of the flow meta API — rather than a magic key insideinputs.@thunderid/react): each flow component (SignIn,SignUp,Recovery,AcceptInvite) reads the active language fromuseTranslation().currentLanguageand setslocaleon the request it builds, inline alongside the other optional fields. No new helper or public surface beyond the typed field.Related Issues
Related PRs
Cross-SDK parity
react-routerandtanstack-routerreuse the react components, so they inherit this automatically.node,express, andbetter-authhave no embedded-flow UI, so they are not applicable.vue,nextjs, andnuxtbuild their own flow-driving components/entry points and need the same wiring as a follow-up (client components attach the framework's current language; the nextjs/nuxt server entry points resolve it from the request). Parity PRs to be raised.Checklist
breaking changelabel added.parity/prs-raisedorparity/prs-not-neededadded.parity/prs-raised, the port links are posted as a reply on the parity check's comment.Security checks