Closed samuel-gomez-axa closed 2 years ago
Can you show me your global layout ? With your Router and your React oidc provider ?
Here my App.js file with AuthenticationProvider
Thanks for your help
i tested to rollback to v2.0.8 and the bug doesn't exist anymore. I also noticed that there was a redirection problem on the callback on my router, this may be related. if this problem persists after fixing this bug, I will do another issue
Since few versions React Oidc is React Router Agnostic. Can you try to switch Router Provider and React OIdc line ?
Like :
<authenticationProvider {...} >
<router {...} >
</router>
<authenticationProvider />
React oidc uses his own history object. He possibly override or hide the history props.
ok thank you, i try it
The switch doesn't fix the bug. I think the bug comes from this file. : AuthenticationConsumers.js
` export const withOidcSecurewithRouter = WrappedComponent => ({ location, history, authenticateUser: authenticateUserInternal, getUserManager: getUserManagerInternal, ...otherProps }) => { const { oidcUser, authenticating, isEnabled } = useOidcSecure( authenticateUserInternal, getUserManagerInternal, location, history ); const requiredAuth = useMemo(() => isRequireAuthentication(oidcUser, false) && isEnabled, [ isEnabled, oidcUser, ]);
const AuthenticatingComponent = authenticating || Authenticating;
return requiredAuth ?
In this HOC, the location and history have been spread but not re-injected in WrappedComponent.
What do you think about this ?
You're probably right
I this this is fixed by v4. May i close the issue @samuel-gomez-axa ?
Issue and Steps to Reproduce
I'm using the HOC withOidcSecure on my routes and renderProps to pass router props.
Since i updated to the v3.0.9-alpha.0 from 2.0.8
i'm losing history prop on pages.
i tested to take of the HOC withOidcSecure and i retreive all router props on my pages.
Versions v3.0.9-alpha.0
Screenshots
props received on my page WITH withOidcSecure
props received on my page WITHOUT withOidcSecure
Expected
Actual
Additional Details