Hello, @archie
When integrating Auth0 with a React Native app, ensuring that the app retains the logged-in state after restarts is crucial. You can do some steps to address this issue: Persistent Authentication State: To maintain the user’s logged-in state across app restarts, consider using a persistent storage mechanism. Store User Info: When the user logs in successfully, store relevant information (such as tokens or user profile data) securely. Use AsyncStorage or a similar solution to save this data. Check Token Expiry:
Ensure that your access tokens have a reasonable expiry time. If a token expires, the user will need to log in again. Handle App Lifecycle Events:
Listen for app lifecycle events (e.g., AppState changes) to trigger actions when the app resumes. When the app reopens, check if the user is still authenticated and restore their session accordingly. Test on Real Devices:
Sometimes issues related to state persistence behave differently on simulators/emulators vs. real devices. Test thoroughly on actual iOS devices to ensure consistent behavior. Remember that maintaining authentication state across app restarts involves a combination of token management, storage, and handling app lifecycle events. I hope this info useful to you,
Best regard MaximTimeClock