Checklist
Description
When a user starts the Auth0 Universal Login flow on Android, the OS aggressively kills the app in the background while the user is in the Auth0 browser completing authentication. When the user finishes and returns to the app, the app has been fully restarted and the SDK has lost its state. the login cannot complete and the user is sent back to the login screen with no error. We are measuring approximately 1,000 failed logins per day from this scenario across various Android devices (Samsung, Nothing Phone, and others).
This has been acknowledged by the Auth0 Android SDK team on the native repo: #972. @pmathew92 confirmed the fix is being included in v4 of the Android SDK. Since react-native-auth0 currently bundles an older version of the native Android SDK, this fix is not yet available to React Native users.
Reproduction
- Install the app on an Android device with aggressive battery optimization enabled (Samsung, Xiaomi, Huawei, or any device with "Don't keep activities" enabled in Developer Options as a reliable emulator equivalent).
- Open the app and tap the login button to start the Auth0 Universal Login flow. The Auth0 browser (Chrome Custom Tab) opens.
- Before completing the login, switch to another app or press the home button. This puts your app in the background.
- The OS kills the app process in the background while the user is still in the browser.
- Return to the browser and complete the login with valid credentials.
- The browser attempts to deep-link back to the app via the redirect URI. The app restarts from a cold start.
- Expected: The SDK recovers the OAuth callback and the user is logged in.
- Actual: The SDK has no record of the in-flight auth attempt. The login silently fails and the user lands on the login screen again.
Easiest way to reproduce on emulator:
- Enable "Don't keep activities" in Developer Options on the emulator.
- Start the login flow.
- As soon as the Auth0 browser opens, press the home button.
- The app is immediately killed (due to the developer option).
- Complete the login in the browser — the app relaunches but the login does not complete.
Additional context
No response
react-native-auth0 version
5.4.1
React Native version
0.81.5
Expo version
No response
Platform
Android
Platform version(s)
16
Checklist
Description
When a user starts the Auth0 Universal Login flow on Android, the OS aggressively kills the app in the background while the user is in the Auth0 browser completing authentication. When the user finishes and returns to the app, the app has been fully restarted and the SDK has lost its state. the login cannot complete and the user is sent back to the login screen with no error. We are measuring approximately 1,000 failed logins per day from this scenario across various Android devices (Samsung, Nothing Phone, and others).
This has been acknowledged by the Auth0 Android SDK team on the native repo: #972. @pmathew92 confirmed the fix is being included in v4 of the Android SDK. Since react-native-auth0 currently bundles an older version of the native Android SDK, this fix is not yet available to React Native users.
Reproduction
Easiest way to reproduce on emulator:
Additional context
No response
react-native-auth0 version
5.4.1
React Native version
0.81.5
Expo version
No response
Platform
Android
Platform version(s)
16