Use two Auth0Provider (one for each React injection) causing one injection not working

Hi @ben.liu,

Welcome to the Auth0 Community.

I understand that you have questions regarding using two Auth0Providers.

Generally, there can only be a single Auth0Provider component that you can use to wrap your application. This will provide the React Context to components that are placed inside your application.

Having more than one Auth0Provider will cause conflicts such as the behavior you see with your implementation.

Regarding a workaround, I recommend checking out this related Community Topic that addresses using two Auth0Providers in a Single React App: https://community.auth0.com/t/using-2-auth0providers-in-a-single-react-app/52455

Please let me know if this resolves your issue.

Thank you.

1 Like