Closed davidfant closed 1 year ago
Hi, I can't reproduce this, it seems to work OK in our examples. Could you modify one of our examples to replicate this issue and/or describe your scenario in more detail?
Also, the code line you linked in SessionAuth
causes it to reload the session from the stored state in every SessionAuth instance instead of reusing values from any parent. This is useful for some of our validations, but (more importantly) it also attaches all the same event handlers that the parent has, so it should get the same updates.
Hi, since I couldn't reproduce this, I'll close the issue, but please feel free to re-open if you can add more details and help me reproduce the issue.
In the following scenario, the child won't get updates to the session context:
I think it's because of this, where a new
SessionContext.Provider
with a context stored in state is wrapping the children: https://github.com/supertokens/supertokens-auth-react/blob/5818082e6a242246edd7578362e7797cda5850e1/lib/ts/recipe/session/sessionAuth.tsx#L68-L70My workaround for now is: