Skip to content

Commit 45d69c5

Browse files
chore(clerk-expo): Accept showInRecents option for opening web browser on useSSO (#6718)
Co-authored-by: FabianUntermoser <FabianUntermoser@users.noreply.github.com>
1 parent a8e7794 commit 45d69c5

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

.changeset/odd-monkeys-rush.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-expo': patch
3+
---
4+
5+
Accepts `showInRecents` in `authSessionOptions` for `useSSO`, preventing the Android web browser tab from closing when navigating away during the SSO flow

packages/expo/src/hooks/useSSO.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { errorThrower } from '../utils/errors';
88
export type StartSSOFlowParams = {
99
redirectUrl?: string;
1010
unsafeMetadata?: SignUpUnsafeMetadata;
11+
authSessionOptions?: Pick<WebBrowser.AuthSessionOpenOptions, 'showInRecents'>;
1112
} & (
1213
| {
1314
strategy: OAuthStrategy;
@@ -41,7 +42,7 @@ export function useSSO() {
4142
};
4243
}
4344

44-
const { strategy, unsafeMetadata } = startSSOFlowParams ?? {};
45+
const { strategy, unsafeMetadata, authSessionOptions } = startSSOFlowParams ?? {};
4546

4647
/**
4748
* Creates a redirect URL based on the application platform
@@ -69,6 +70,7 @@ export function useSSO() {
6970
const authSessionResult = await WebBrowser.openAuthSessionAsync(
7071
externalVerificationRedirectURL.toString(),
7172
redirectUrl,
73+
authSessionOptions,
7274
);
7375
if (authSessionResult.type !== 'success' || !authSessionResult.url) {
7476
return {

0 commit comments

Comments
 (0)