Skip to content

Rename redirect and fallback url props #943

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
6 changes: 4 additions & 2 deletions docs/components/authentication/sign-in.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ All props are optional.
| `routing` | `'hash' \| 'path' \| 'virtual'` | The routing strategy for your pages.<br />Defaults to `'path'` in Next.js and Remix applications. Defaults to `hash` for all other SDK's. |
| `path` | `string` | The path where the component is mounted on when `routing` is set to `path`. It is ignored in hash- and virtual-based routing.<br />For example: `/sign-in`. |
| `signUpUrl` | `string` | Full URL or path to the sign up page. Use this property to provide the target of the 'Sign Up' link that's rendered. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signInFallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signInForceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs in. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `forceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs in. Takes priority over legacy props such as `afterSignInUrl` and `redirectUrl`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signUpForceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs up. Takes priority over legacy props such as `afterSignInUrl` and `redirectUrl`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `fallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. Defaults to `/`. Takes priority over legacy props such as `afterSignInUrl` and `redirectUrl`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signUpFallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. Defaults to `/`. Takes priority over legacy props such as `afterSignInUrl` and `redirectUrl`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `initialValues` | [`SignInInitialValues`](/docs/references/javascript/types/sign-in-initial-values) | The values used to prefill the sign-in fields with. |

## Usage with frameworks
Expand Down
6 changes: 4 additions & 2 deletions docs/components/authentication/sign-up.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ All props are optional.
| `routing` | `'hash' \| 'path' \| 'virtual'` | The routing strategy for your pages. <br />Defaults to `'path'` in Next.js and Remix applications. Defaults to `hash` for all other SDK's. |
| `path` | `string` | The path where the component is mounted on when `routing` is set to `path`. It is ignored in hash- and virtual-based routing.<br />For example: `/sign-up`. |
| `signInUrl` | `string` | Full URL or path to the sign in page. Use this property to provide the target of the 'Sign In' link that's rendered. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signUpFallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signUpForceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs up. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `fallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. Defaults to `/`. Takes priority over legacy props such as `afterSignUpUrl` and `redirectUrl`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signInFallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. Defaults to `/`. Takes priority over legacy props such as `afterSignUpUrl` and `redirectUrl`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `forceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs up. Takes priority over legacy props such as `afterSignUpUrl` and `redirectUrl`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signInForceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs in. Takes priority over legacy props such as `afterSignUpUrl` and `redirectUrl`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `initialValues` | [`SignUpInitialValues`](/docs/references/javascript/types/sign-up-initial-values) | The values used to prefill the sign-up fields with. |

## Usage with frameworks
Expand Down
4 changes: 2 additions & 2 deletions docs/components/control/authenticate-with-callback.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ The `<AuthenticateWithRedirectCallback />` is used to complete a custom OAuth fl

| Name | Type | Description |
| --- | --- | --- |
| `afterSignInUrl` | `string` | Full URL or path to navigate to after successful sign in. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `afterSignInUrl` (legacy) | `string` | Full URL or path to navigate to after successful sign in. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. **`signInFallbackRedirectUrl` has priority over the legacy `afterSignInUrl`. Use `fallbackRedirectUrl` or `forceRedirectUrl` instead of `afterSignInUrl`.** |
| `afterSignUpUrl` | `string` | Full URL or path to navigate to after successful sign up. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `redirectUrl` | `string` | Full URL or path to navigate after successful sign in or sign up. This is the same as setting `afterSignInUrl` and `afterSignUpUrl` to the same value. |
| `redirectUrl` (legacy) | `string` | Full URL or path to navigate after successful sign in or sign up. This is the same as setting `afterSignInUrl` and `afterSignUpUrl` to the same value. **`signInFallbackRedirectUrl` has priority over the legacy `redirectUrl`. Use `fallbackRedirectUrl` or `forceRedirectUrl` instead of `redirectUrl`.** |
| `secondFactorUrl` | `string` | Full URL or path to navigate during sign in, if 2FA is enabled. |
6 changes: 4 additions & 2 deletions docs/components/unstyled/sign-in-button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ The `<SignInButton>` component is a button that links to the sign-in page or dis

| Name | Type | Description |
| --- | --- | --- |
| `signInFallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signInForceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs in. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `forceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs in. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signUpForceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs up. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `fallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signUpFallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `mode?` | `'redirect' \| 'modal'` | Determines what happens when a user clicks on the `<SignInButton>`. Setting this to `'redirect'` will redirect the user to the sign-in route. Setting this to `'modal'` will open a modal on the current route.<br />Defaults to `'redirect'`. |
| `children?` | `React.ReactNode` | Children you want to wrap the `<SignInButton>` in. |

Expand Down
1 change: 1 addition & 0 deletions docs/components/unstyled/sign-out-button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The type of the `signOutOptions` prop for the `<SignOutButton>` component is def
| Name | Type | Description |
| --- | --- | --- |
| `sessionId?` | `string` | The ID of a specific session to sign out of. Useful for multi-session applications. |
| `redirectUrl?` | `string` | The a redirect URL to navigate to after sign out is complete. |

## How to use the `<SignOutButton>` component

Expand Down
6 changes: 4 additions & 2 deletions docs/components/unstyled/sign-up-button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ The `<SignUpButton>` component is a button that links to the sign-up page or dis

| Name | Type | Description |
| --- | --- | --- |
| `signUpFallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signUpForceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs up. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `forceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs up. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signInForceRedirectUrl?` | `string` | If provided, this URL will always be redirected to after the user signs in. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `fallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs up, if there's no `redirect_url` in the path already. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `signInFallbackRedirectUrl?` | `string` | The fallback URL to redirect to after the user signs in, if there's no `redirect_url` in the path already. Defaults to `/`. It's recommended to use [the environment variable](/docs/deployments/clerk-environment-variables#sign-in-and-sign-up-redirects) instead. |
| `mode?` | `'redirect' \| 'modal'` | Determines what happens when a user clicks on the `<SignUpButton>`. Setting this to `'redirect'` will redirect the user to the sign-up route. Setting this to `'modal'` will open a modal on the current route.<br />Defaults to `'redirect'` |
| `children?` | `React.ReactNode` | Children you want to wrap the `<SignUpButton>` in. |

Expand Down
2 changes: 1 addition & 1 deletion docs/references/javascript/sign-in/authenticate-with.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promi
| Name | Type | Description |
| --- | --- | --- |
| `strategy` | <code>[OAuthStrategy](/docs/references/javascript/types/oauth#o-auth-strategy) \| 'saml'</code> | The strategy corresponding to the OAuth provider. For example: `oauth_facebook`, `oauth_github`, etc. |
| `redirectUrl` | `string` | The URL that the OAuth provider should redirect to, on successful authorization on their part. |
| `redirectUrl` (legacy) | `string` | The URL that the OAuth provider should redirect to, on successful authorization on their part. **`signInFallbackRedirectUrl` has priority over the legacy `redirectUrl`. Use `fallbackRedirectUrl` or `forceRedirectUrl` instead of `redirectUrl`.** |
| `redirectUrlComplete` | `string` | The URL that the user will be redirected to, after successful authorization from the OAuth provider and Clerk sign in. |

### `authenticateWithMetamask()`
Expand Down
2 changes: 1 addition & 1 deletion docs/references/javascript/sign-in/sign-in.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function createEmailLinkFlow(): {
| Name | Type | Description |
| --- | --- | --- |
| `emailAddressId` | `string` | The ID of the user's email address that's going to be used as the first factor identification for verification. |
| `redirectUrl` | `string` | The email link target URL. Users will be redirected here once they click the email link from their email. |
| `redirectUrl` (legacy) | `string` | The email link target URL. Users will be redirected here once they click the email link from their email. **`signInFallbackRedirectUrl` has priority over the legacy `redirectUrl`. Use `fallbackRedirectUrl` or `forceRedirectUrl` instead of `redirectUrl`.** |

## Additional methods

Expand Down
2 changes: 1 addition & 1 deletion docs/references/javascript/sign-up/authenticate-with.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promi

| Name | Type | Description |
| --- | --- | --- |
| `redirectUrl` | `string` | Full URL or path to the route that will complete the OAuth or SAML flow. Typically, this will be a simple `/sso-callback` route that calls [`Clerk.handleRedirectCallback`](/docs/references/javascript/clerk/handle-navigation#handle-redirect-callback) or mounts the [`<AuthenticateWithRedirectCallback />`](/docs/components/control/authenticate-with-callback) component. |
| `redirectUrl` (legacy) | `string` | Full URL or path to the route that will complete the OAuth or SAML flow. Typically, this will be a simple `/sso-callback` route that calls [`Clerk.handleRedirectCallback`](/docs/references/javascript/clerk/handle-navigation#handle-redirect-callback) or mounts the [`<AuthenticateWithRedirectCallback />`](/docs/components/control/authenticate-with-callback) component. **`signInFallbackRedirectUrl` has priority over the legacy `redirectUrl`. Use `fallbackRedirectUrl` or `forceRedirectUrl` instead of `redirectUrl`.** |
| `redirectUrlComplete` | `string` | Full URL or path to navigate after the OAuth or SAML flow completes. |
| `continueSignUp` | `boolean \| undefined` | Whether to continue (i.e. PATCH) an existing [`SignUp`][signup-ref] (if present) or create a new [`SignUp`][signup-ref]. |
| `strategy` | `'oauth_<provider>' \| 'saml'` | The strategy to use for authentication.<br />The following strategies are supported:<br /><ul><li>`oauth_<provider>`: The user will be authenticated with their social sign-in account. See available [OAuth providers](/docs/references/javascript/types/oauth#o-auth-provider).</li><li>`saml`: The user will be authenticated with SAML.</li></ul> |
Expand Down
4 changes: 2 additions & 2 deletions docs/references/javascript/sign-up/sign-up.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function create(params: SignUpCreateParams): Promise<SignUpResource>;
| `username` | `string \| null` | The user's username. This option is available only if usernames are enabled. Please check the instance settings for more information. |
| `unsafeMetadata` | `{[string]: any} \| null` | Metadata that can be read and set from the frontend. Once the sign-up is complete, the value of this field will be automatically copied to the newly created user's unsafe metadata. One common use case for this attribute is to use it to implement custom fields that can be collected during sign-up and will automatically be attached to the created `User` object. |
| `strategy` | `'oauth_<provider>' \| 'saml' \| 'ticket'` | The strategy to use for the sign-up flow.<br />The following strategies are supported:<br /><ul><li>`oauth_<provider>`: The user will be authenticated with their social sign-in account. See available [OAuth providers](/docs/references/javascript/types/oauth#o-auth-provider).</li><li>`saml`: The user will be authenticated with SAML.</li><li>`ticket`: The user will be authenticated via the ticket *or token* generated from the Backend API.</li></ul> |
| `redirectUrl` | `string` | The redirect URL after the sign-up flow has completed. |
| `redirectUrl` (legacy) | `string` | The redirect URL after the sign-up flow has completed. **`signInFallbackRedirectUrl` has priority over the legacy `redirectUrl`. Use `fallbackRedirectUrl` or `forceRedirectUrl` instead of `redirectUrl`.** |
| `actionCompleteRedirectUrl?` | `string` |The URL that the user will be redirected to, after successful authorization from the OAuth provider and Clerk sign in. This parameter is required only if `strategy` is set to an OAuth strategy like `oauth_<provider>`, or set to `saml`. |
| `ticket` | `string` | Provide the ticket *or token* generated from the Backend API. This parameter is required only if `strategy` is set to `ticket`. |
| `transfer` | `boolean` | Transfer the user to a dedicated sign-up for an OAuth flow. |
Expand Down Expand Up @@ -136,7 +136,7 @@ function createEmailLinkFlow(): {

| Name | Type | Description |
| --- | --- | --- |
| `redirectUrl` | `string` | The email link target URL. Users will be redirected here once they click the email link from their email. |
| `redirectUrl` (legacy) | `string` | The email link target URL. Users will be redirected here once they click the email link from their email. **`signInFallbackRedirectUrl` has priority over the legacy `redirectUrl`. Use `fallbackRedirectUrl` or `forceRedirectUrl` instead of `redirectUrl`.** |

## Additional methods

Expand Down
Loading
Loading