Repository navigation
Recover a lost config before a silent sign-in in the React SDK - #125
Merged
brionmario merged 1 commit intoOct 16, 2026
Merged
Conversation
With React 19 strict mode the provider initializes the client twice, and the config intermittently fails to land in storage. signIn() already re-runs initialization when it finds the stored config empty, but signInSilently() did not. The first silent sign-in on such a page read an empty config, found neither a base URL nor a discovery endpoint, and failed with "Some or all of the required endpoints are missing". A refresh re-initialized cleanly, so it then worked. Move the recovery into ensureConfigData() and call it from both signIn() and signInSilently(). It also treats a stored config that has lost the base URL it was initialized with as lost, not only an empty one. Signed-off-by: Brion <[email protected]>
|
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 |
DonOmalVindula
approved these changes
Oct 16, 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
In the React SDK, the first
signInSilently()on a page can fail straight away:After a refresh, it works. I hit this in a Vite + React 19 sample running under
<StrictMode>, against@thunderid/[email protected]. The call was rejected after 28 ms, before any iframe was created.ThunderIDReactClient.signIn()already documents the cause:signIn()re-runs initialization when it finds the stored config empty, butsignInSilently()didn't. So a silent sign-in on an affected page read an empty config. With nobaseUrland no discovery URL, endpoint resolution fell through toresolveEndpointsExplicitly(), which threw the error above.Approach
ensureConfigData(), now called by bothsignIn()andsignInSilently().baseUrlthe client was initialized with. That is the shape this error implies.signIn()already does. Vue doesn't double-mount, so it doesn't have this workaround and doesn't need it.Verification
ThunderIDReactClient.configRecovery.test.tscovers three cases:signInSilently()re-initializes when the stored config is missing;baseUrl;@thunderid/reacttests pass (135). Typecheck and format are clean, and lint onThunderIDReactClient.tsis unchanged.Cross-SDK parity: not needed. This is a React 19 StrictMode workaround in the React SDK only.
Related Issues
Related PRs
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