Skip to content

fix: preserve user-provided id in initialState instead of overwriting (#351)#352

Open
a-kriya wants to merge 2 commits intothefrontside:mainfrom
a-kriya:user-id-override
Open

fix: preserve user-provided id in initialState instead of overwriting (#351)#352
a-kriya wants to merge 2 commits intothefrontside:mainfrom
a-kriya:user-id-override

Conversation

@a-kriya
Copy link

@a-kriya a-kriya commented Mar 24, 2026

Fixes #351

Motivation

To fix a bug where the user id provided in initialState would get ignored.

Approach

Similar to how the other fields are handled, the id is now also conditionally set if it is not already provided.

TODOs and Open Questions

  • add unit tests to cover this functionality; which I'm now planning to do in another commit since I ended up refactoring some stuff to make the test suite easier to run

@jbolda
Copy link
Member

jbolda commented Mar 24, 2026

Looks like it missed creating the preview package. I think #353 should fix it if you merge from the main branch. That should allow you to try it out in your project right away.

@a-kriya
Copy link
Author

a-kriya commented Mar 25, 2026

Rebased on main, and added a separate commit for the test refactor along with new tests to cover this bug.

Feel free to modify things--I basically wanted to be able to run the tests without needing to install SSL certificate, so I made modifications to run the tests over http.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth0: setting initialState.users.id does not reflect on the subject (sub) of the token payload

2 participants