You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The same `allowedBrowserPackages` option is also accepted by `clearSession` to restrict which browser handles the logout flow.
1979
1984
1985
+
## Recovering Login After Process Death (Android)
1986
+
1987
+
On Android, the OS can kill your app's process while the user is completing login in the browser — this is common on devices with aggressive memory management (e.g. Samsung One UI, Xiaomi MIUI), especially during MFA when the user switches apps to fetch a code. When the user finishes and the browser redirects back, the app cold-starts and, without recovery, the in-flight login is lost and the user lands back on the login screen.
1988
+
1989
+
`resumeSession()` recovers that login. The underlying native SDK finishes the token exchange after the process restarts and buffers the result; calling `resumeSession()` once on cold start drains it and returns the recovered `Credentials` (or `null` if there was nothing to recover).
1990
+
1991
+
> This is an Android-only concern. On iOS and web `resumeSession()` is a no-op that resolves with `null`, so it is safe to call unconditionally. It requires `react-native-auth0` bundling Auth0.Android 3.19.0+ (included). No native `MainActivity` changes are needed, so it works the same in bare React Native and Expo.
1992
+
1993
+
### Recovering Login Using Hooks
1994
+
1995
+
Call `resumeSession()` once when your app mounts. If it returns credentials, the hook updates the auth state and persists them automatically, so `user` becomes populated.
1996
+
1997
+
```js
1998
+
import { useEffect } from'react';
1999
+
import { useAuth0 } from'react-native-auth0';
2000
+
2001
+
constApp= () => {
2002
+
const { resumeSession } =useAuth0();
2003
+
2004
+
useEffect(() => {
2005
+
resumeSession()
2006
+
.then((credentials) => {
2007
+
if (credentials) {
2008
+
// A login interrupted by process death was recovered.
// The user is logged in — route them into the app.
2036
+
}
2037
+
```
2038
+
1980
2039
## DPoP (Demonstrating Proof-of-Possession)
1981
2040
1982
2041
[DPoP](https://datatracker.ietf.org/doc/html/rfc9449) (Demonstrating Proof-of-Possession) is an OAuth 2.0 extension that cryptographically binds access and refresh tokens to a client-specific key pair. This prevents token theft and replay attacks by ensuring that even if a token is intercepted, it cannot be used from a different device.
Copy file name to clipboardExpand all lines: FAQ.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,24 @@ See these issues for more information:
159
159
-[possibility to run with launchMode:singleTop?](https://github.com/auth0/react-native-auth0/issues/170)
160
160
-[Android singleTask launch mode is required for react-native deep links](https://github.com/auth0/react-native-auth0/issues/556)
161
161
162
-
### The solution
162
+
### Recovering the login (recommended)
163
+
164
+
If the OS kills your app's process entirely while the browser is open (rather than just pausing the activity), the SDK can still complete the login on restart. Call `resumeSession()` once on cold start to recover it:
If a login was interrupted by process death, `resumeSession()` returns the recovered `Credentials`; otherwise it returns `null`. It is Android-only (a no-op resolving `null` on iOS/web) and requires no `MainActivity` changes, so it works in both bare React Native and Expo. See [Recovering Login After Process Death (Android)](EXAMPLES.md#recovering-login-after-process-death-android) for full examples.
178
+
179
+
### The solution (for `singleTask` launch mode)
163
180
164
181
If your Android `launchMode` is set to `singleTask` (check your `AndroidManifest.xml`), that's why this is occurring. Unfortunately, this is not addressable by the react-native-auth0 library.
0 commit comments