react-native-auth0
react-native-auth0 copied to clipboard
Supporting multiple domains in the SDK
Checklist
- [X] The issue can be reproduced in the react-native-auth0 sample app (or N/A).
- [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- [X] I have looked into the API documentation and have not found a suitable solution or answer.
- [X] I have searched the issues and have not found a suitable solution or answer.
- [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [X] I agree to the terms within the Auth0 Code of Conduct.
Description
Create a new Auth0Provider
with a different domain
prop still results in directing users to the initial domain
when using the authorize method provided by useAuth0
hook.
Worked on 2.17.4
Reproduction
- Initialise the
Auth0Provider
with any validdomain
prop - Initialise a new
Auth0Provider
with a new validdomain
prop - Observe that the login function provided by
useAuth0
still directs the browser to the initial domain
Additional context
We use multiple Auth0 Tenants to isolate users from different customers and in our React Native app we allow the user to select which customer they are from and thus we dynamically change the domain
being sent to the Auth0 SDK.
This worked well up until we upgraded to v3 and now it fails to change the domain. I have traced it through the auth0 SDK and found the domain change is successfully being propogated all the way to the NativeModule import; but the SDK still directs the browser window to the previously set domain. Seems like the domain gets cached somewhere (perhaps the useAuth0 hook using the old object?)
I understand that Organisations is the recommended approach to this use case now; but the use of auth0 tenenants is still listed as a supported method - and thus I believe this change to be a bug.
Note: this has already been asked on the forums but no answer has been given for over a year
react-native-auth0 version
3.0.1
React Native version
0.72.5
Expo version
49.0.0
Platform
Android
Platform version(s)
13