Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisintech committed Nov 12, 2024
1 parent f51bc19 commit 400d1cd
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions docs/deployments/deploy-expo.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,21 @@ Clerk ensures that security critical nonces will be passed only to allowlisted U

So for maximum security in your production instances, you need to allowlist your custom redirect URLs:

1. Navigate to the [Clerk Dashboard](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections).
1. In the top navigation, select **Configure**. Then in the sidebar, select **SSO Connections**.
1. In the Clerk Dashboard, navigate to the [**SSO Connections**](https://dashboard.clerk.com/last-active?path=user-authentication/sso-connections) page.
1. Scroll to the **Allowlist for mobile OAuth redirect** section and add your redirect URLs.
1. The default is `your-app-scheme://oauth-native-callback`
1. If you'd like to pass a custom redirect url, make sure you add that to the allowlist.

To determine the proper redirect url when using the `useOauth` helper function, you'd use the pattern of `{SCHEME}/{PATH}`. As an example, you'd add `myapp://dashboard` to the allowlist for the following code snippet:

```ts
const { startOAuthFlow } = useOAuth({ strategy: `oauth_apple` })

const onPress = React.useCallback(async () => {
const { createdSessionId, setActive } = await startOAuthFlow({
redirectUrl: Linking.createURL('dashboard', { scheme: 'myapp' }),
})

// Removed for brevity...
}, [])
```
1. The default is `<INSERT-YOUR-APP-SCHEME>://oauth-native-callback`
1. If you'd like to pass a custom redirect URL, make sure you add that to the allowlist. The format is `<INSERT-YOUR-APP-SCHEME>/{PATH}`. For example, the redirect URL for the following code example is `myapp://dashboard`.
```ts
const { startOAuthFlow } = useOAuth({ strategy: `oauth_apple` })

const onPress = React.useCallback(async () => {
const { createdSessionId, setActive } = await startOAuthFlow({
redirectUrl: Linking.createURL('dashboard', { scheme: 'myapp' }),
})

// The rest of your code...
}, [])
```

> [!TIP]
> You can also add redirect URLs via [the Backend API](/docs/reference/backend-api/tag/Redirect-URLs#operation/CreateRedirectURL).
Expand Down

0 comments on commit 400d1cd

Please sign in to comment.