Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/appauth-android-request-lifecycle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"react-native-app-auth": patch
---

Snapshot token headers, TLS policy, timeout, parameters, client authentication, PKCE verifier and promise per interactive flow. Keep refresh/registration independent, reject overlapping browser flows without replacing the first, and settle late token failures on their originating promise. Replace the blocking/global prefetch latch with per-issuer asynchronous completion; expose native prefetch completion and errors through the JS promise.
10 changes: 10 additions & 0 deletions docs/docs/usage/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,13 @@ See specific example [configurations for your provider](/docs/category/providers
- **androidAllowCustomBrowsers** - (`string[]`) (default: undefined) _ANDROID_ override the used browser for authorization. If no value is provided, all browsers are allowed.
- **androidTrustedWebActivity** - (`boolean`) (default: `false`) _ANDROID_ Use [`EXTRA_LAUNCH_AS_TRUSTED_WEB_ACTIVITY`](https://developer.chrome.com/docs/android/trusted-web-activity/) when opening web view.
- **connectionTimeoutSeconds** - (`number`) configure the request timeout interval in seconds. This must be a positive number. The default values are 60 seconds on iOS and 15 seconds on Android.

### Android request isolation

Custom headers and token-exchange options belong to each call. Pass any required headers on every call;
omitting a header group does not reuse a previous provider's headers. Refresh and registration may run
while authorization is pending without replacing its token-exchange parameters or timeout.

Only one browser-based authorization or logout can be pending at a time. A second interactive call
rejects with `authentication_in_progress`; finish or cancel the first before retrying. A token exchange
already running after the browser returns keeps its own promise and configuration.
10 changes: 9 additions & 1 deletion docs/docs/usage/prefetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,13 @@ const config = {
scopes: ['<YOUR_SCOPES_ARRAY>'],
};

prefetchConfiguration(config);
try {
await prefetchConfiguration(config);
} catch (error) {
// Prefetch is optional. authorize() can retry discovery when needed.
}
```

The promise resolves only after configuration is available and rejects when discovery fails.
Cached issuers resolve immediately; prefetching a different issuer fetches its own configuration.
Calls on iOS remain a no-op. Handle rejection if you previously called this method without awaiting it.
Loading