AxaFrance / oidc-client

Light, Secure, Pure Javascript OIDC (Open ID Connect) Client. We provide also a REACT wrapper (compatible NextJS, etc.).
MIT License
597 stars 160 forks source link

React router route component unmounts on history state changes when using withOidcSecure #591

Closed edgaraskazlauskas closed 2 years ago

edgaraskazlauskas commented 3 years ago

Issue and Steps to Reproduce

React router route component unmounts on history state changes when using withOidcSecure. To reproduce, do a history.push call changing only the search params or history state (without changing location), take note that the given component for the route rerenders and loses all local state.

Expected

Component for given route does not reload (as is when not using withOidcSecure).

Actual

Component for given route reloads.

rahul-sharma-uipath commented 3 years ago

take a look at https://github.com/AxaGuilDEv/react-oidc/issues/541 - we wanted to use this library but this was a pretty big limitation so we ended up forking and using that users solution. This issue should be looked at more closely by @youf-olivier and team however and the fix is relatively straightforward so you could also just wait for the official solution.

youf-olivier commented 3 years ago

Yes, I have to take this one. I have some times this week. I started to take some issue.

But this one is a bit tricky. I'll take this one soon.

tielushko commented 3 years ago

Hi, I was wondering if there is any update regarding this issue?

guillaume-chervet commented 2 years ago

This is fixed by the future v4 version https://www.npmjs.com/package/@axa-fr/react-oidc-context

guillaume-chervet commented 2 years ago

V4 solve this issue.

guillaume-chervet commented 2 years ago

I close the issue fixed with v4. Feel free to reopen it if needed.