Can't logout with SFSafariViewController in react-native-auth0


I am implementing react-native-auth0 in our (ios only) mobile app and have looked at the FAQ for avoiding the login alert box.

We do not need SSO, but we do want the session data to be stored, so { ephemeralSession: true } does’t seem to be right for us.

Trying SFSafariViewController instead, this maintains the session after restarting the phone, but calling clearSession() still triggers the popup and does not clear the session anymore.

Is there a way to avoid both of these issues?

It seems similar to this issue which doesn’t have a clear solution.

Thanks in advance.

If you’re using react-native-auth0 in your iOS mobile app and want to avoid the login alert box while still maintaining session data storage, you can try the following approach:

  1. Set useBrowser: true in the Auth0 configuration to use the SFSafariViewController for authentication.

  2. To clear the session without triggering the login alert box, you can try the following steps:

    a. Instead of using clearSession(), you can use revoke() to revoke the user’s session tokens.

    b. After revoking the session tokens, you can use clearCredentials() to clear the stored user credentials.

By using revoke() and clearCredentials(), you should be able to clear the session without triggering the login alert box.

Please note that the exact implementation details may vary depending on the version of react-native-auth0 you are using. It’s recommended to consult the library’s documentation or seek assistance from the library’s support channels for more specific guidance on clearing the session without triggering the login alert box.