Direct sign-in entry
Set a predictable landing page for users who open the sign-in route directly without a preserved destination.
Clerk · Pipe
Clerk’s signInFallbackRedirectUrl sets the post-sign-in destination when no redirect_url is already present. It defaults to / and is also used by sign-in links rendered from sign-up components.
This optional Clerk component prop supplies the destination after sign-in only when the current flow lacks a redirect_url. It defaults to /, and Clerk recommends configuring the corresponding environment variable instead when possible. The prop is also used for the sign-in link rendered by sign-up components.
signInFallbackRedirectUrl?: string| Name | Type | Description |
|---|---|---|
signInFallbackRedirectUrl | string | Optional fallback destination used after sign-in when no redirect_url exists; defaults to /. |
import { ClerkProvider } from '@clerk/nextjs';
export default function RootLayout({
children,
}: Readonly<{ children: React.ReactNode }>) {
return (
<ClerkProvider signInFallbackRedirectUrl="/dashboard">
{children}
</ClerkProvider>
);
}Sets /dashboard as the sign-in fallback when no redirect_url is already present.
Set a predictable landing page for users who open the sign-in route directly without a preserved destination.
Send users who switch from a sign-up screen to sign-in to an appropriate application page.
Provide component-level redirect configuration when an environment variable is not used.
It is an optional URL prop that Clerk uses after sign-in when the path has no redirect_url. Its default destination is /, and an existing redirect_url takes precedence.
Follow-up: When would the prop have no effect? It has no effect when redirect_url is present, because the fallback is only consulted when that value is absent.
On sign-up components, it controls the destination for the rendered “Already have an account? Sign in” link. It is distinct from the general fallbackRedirectUrl used by sign-in and sign-up related components.
Follow-up: Why can this matter in a sign-up flow? A user who switches from sign-up to sign-in needs a sign-in-specific fallback destination, so the two settings can differ.
The documentation recommends using the relevant environment variable instead of the prop whenever possible. It also recommends defining both sign-in and sign-up fallback variables because users can switch between those flows.
Follow-up: What should be checked before relying on the fallback? Verify that no redirect_url is already in the path, since that value takes precedence.
fallbackRedirectUrlsignUpFallbackRedirectUrlCLERK_SIGN_IN_FALLBACK_REDIRECT_URLNEXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URLNUXT_PUBLIC_CLERK_SIGN_IN_FALLBACK_REDIRECT_URLredirect_url