diff --git a/docs/references/nextjs/custom-signup-signin-pages.mdx b/docs/references/nextjs/custom-signup-signin-pages.mdx index 024ec13927..14a2899bb8 100644 --- a/docs/references/nextjs/custom-signup-signin-pages.mdx +++ b/docs/references/nextjs/custom-signup-signin-pages.mdx @@ -18,51 +18,31 @@ If the prebuilt components don't meet your specific needs or if you require more ### Build a sign-up page - Create a new file that will be used to render the sign-up page. In the file, import the [``](/docs/components/authentication/sign-up) component from `@clerk/nextjs` and render it. + The following example demonstrates how to render the [``](/docs/components/authentication/sign-up) component. - - ```tsx {{ filename: 'app/sign-up/[[...sign-up]]/page.tsx' }} - import { SignUp } from '@clerk/nextjs' + ```tsx {{ filename: 'app/sign-up/[[...sign-up]]/page.tsx' }} + import { SignUp } from '@clerk/nextjs' - export default function Page() { - return - } - ``` - - ```tsx {{ filename: '/pages/sign-up/[[...index]].tsx' }} - import { SignUp } from '@clerk/nextjs' - - export default function Page() { - return - } - ``` - + export default function Page() { + return + } + ``` ### Build a sign-in page - Create a new file that will be used to render the sign-in page. In the file, import the [``](/docs/components/authentication/sign-in) component from `@clerk/nextjs` and render it. + The following example demonstrates how to render the [``](/docs/components/authentication/sign-in) component. - - ```tsx {{ filename: 'app/sign-in/[[...sign-in]]/page.tsx' }} - import { SignIn } from '@clerk/nextjs' + ```tsx {{ filename: 'app/sign-in/[[...sign-in]]/page.tsx' }} + import { SignIn } from '@clerk/nextjs' - export default function Page() { - return - } - ``` - - ```tsx {{ filename: '/pages/sign-in/[[...index]].tsx' }} - import { SignIn } from '@clerk/nextjs' - - export default function Page() { - return - } - ``` - + export default function Page() { + return + } + ``` ### Make the sign-up and sign-in routes public - By default, `clerkMiddleware()` makes all routes public. This step is specifically for applications that have configured `clerkMiddleware()` to make [all routes protected](/docs/references/nextjs/clerk-middleware#protect-all-routes). If you have not configured `clerkMiddleware()` to protect all routes, you can skip this step. + By default, `clerkMiddleware()` makes all routes public. **This step is specifically for applications that have configured `clerkMiddleware()` to make [all routes protected](/docs/references/nextjs/clerk-middleware#protect-all-routes).** If you have not configured `clerkMiddleware()` to protect all routes, you can skip this step. To make the sign-up and sign-in routes public: @@ -93,9 +73,7 @@ If the prebuilt components don't meet your specific needs or if you require more ### Update your environment variables - In the previous steps, a `path` prop is passed to the `` and `` components. This is because the components need to know which route they are originally mounted on. - - In Next.js applications, you can either pass the `path` prop, _or_ you can define the `NEXT_PUBLIC_CLERK_SIGN_IN_URL` and `NEXT_PUBLIC_CLERK_SIGN_UP_URL` environment variables, like so: + Update your environment variables to point to your custom sign-in and sign-up pages. Learn more about the available [environment variables](/docs/deployments/clerk-environment-variables). ```env {{ filename: '.env.local' }} NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in @@ -104,7 +82,7 @@ If the prebuilt components don't meet your specific needs or if you require more ### Visit your new pages - Run your project with the following terminal command from the root directory of your project: + Run your project with the following command: ```bash {{ filename: 'terminal' }} @@ -131,7 +109,7 @@ If the prebuilt components don't meet your specific needs or if you require more --- - - [Client Side Helpers](/docs/references/nextjs/overview#client-side-helpers) + - [Client-side helpers](/docs/references/nextjs/overview#client-side-helpers) - Learn more about Next.js client-side helpers and how to use them. ---