Using react-native-auth0 v5.4.0
The authorize method has a parameter ephemeralSession which, when set to true, avoids the Apple popup about logging in.
The clearSession method has no such parameter. When invoked, it always displays the Apple popup (which, annoyingly says you are going to login, not logout).
I want to get rid of the logout popup.
If this is requires a new feature, it is somewhat low in priority: the primary use case is testing - I need to switch between accounts on my mobile for testing different behaviors, so I must kill the Auth0 session when logging out, but that means the popup appears.
I don’t think there is an end user use case for this one. It is just a nice-to-have, plus the popup box (with the incorrect text) looks shoddy.
Hi @Storyaliz,
Welcome to the Auth0 Community!
The Logout alert is a mandatory security feature of the iOS ASWebAuthenticationSession when it needs to access the shared cookie jar to perform a federated logout.
The solution for this use case is presented within this article - System Alert During Logout When Using Non-Ephemeral Sessions In iOS Swift SDK.
In order to avoid having the logout alert box you can simply not call clearSession(federated:) and just clear the credentials from the app. Because you are using ephemeralSession: true in your authorize call, you don’t actually need do it anymore since ephemeralSession tells iOS not to share cookies with Safari. When you “log out,” you just delete the tokens from your app’s local storage.
This means that the shared session cookie will not be removed, so to get the user to log in again you need to add the "prompt": "login" parameter to the login call, giving the users a fresh login this way.
I hope this helps and if you have further questions please let me know!
Thanks,
Remus