@@ -64,7 +64,23 @@ The code used in the following quickstart is available in the
6464 src = " https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-pages-router/middleware.ts"
6565 />
6666
67- 4 . Create a new folder named ` pages ` in the root of your project. Inside the ` pages ` folder, create a new folder named ` auth ` .
67+ 4 . Configure browser redirects in your Ory Console. Navigate to ** Branding** > ** Browser redirects** and set the ** Global redirect
68+ URL** to ` /ui/welcome ` . This ensures users are redirected to the correct page after completing authentication flows.
69+
70+ ![ Browser Redirects Configuration] ( ../_static/nextjs/branding_browser_redirects.png )
71+
72+ 5 . Create a new folder named ` components ` in the root of your project. Inside the ` components ` folder, create a new file named
73+ ` custom-card-header.tsx ` and add the following code:
74+
75+ <CodeFromRemote
76+ lang = " tsx"
77+ title = " components/custom-card-header.tsx"
78+ src = " https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-app-router/components/custom-card-header.tsx"
79+ />
80+
81+ This component is used by the Verification and Settings pages to customize the card header.
82+
83+ 6 . Create a new folder named ` pages ` in the root of your project. Inside the ` pages ` folder, create a new folder named ` auth ` .
6884 Inside the ` auth ` folder, create the following files:
6985
7086 - ` login.tsx `
@@ -118,7 +134,16 @@ The code used in the following quickstart is available in the
118134 </Tabs>
119135 ```
120136
121- 5 . Run the application and create your first user by navigating to ` /auth/registration ` . After registration, you can log in at
137+ 7 . Use your own Ory Network project by setting the ` ORY_SDK_URL ` environment variable in your ` .env ` file:
138+
139+ ``` mdx-code-block
140+ <CodeFromRemote lang="bash" title=".env" src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-pages-router/.env" />
141+ ```
142+
143+ You can find your Ory Network project URL in the [ ** Get started** ] ( https://console.ory.sh/projects/current/get-started ) section
144+ of the Ory Console.
145+
146+ 8 . Run the application and create your first user by navigating to ` /auth/registration ` . After registration, you can log in at
122147 ` /auth/login ` . You can also access the other self-service flows at the following URLs:
123148
124149 - Recovery: ` /auth/recovery `
@@ -152,18 +177,9 @@ The code used in the following quickstart is available in the
152177
153178 Open your browser and navigate to ` http://localhost:3000/auth/registration ` to create your first user.
154179
155- 6 . Optional: use your own Ory Network project by setting the ` ORY_SDK_URL ` environment variable in your ` .env ` file:
156-
157- ``` mdx-code-block
158- <CodeFromRemote lang="bash" title=".env" src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-pages-router/.env" />
159- ```
160-
161- You can find your Ory Network project URL in the [ ** Get started** ] ( https://console.ory.sh/projects/current/get-started ) section
162- of the Ory Console.
163-
164180## Next steps
165181
166- Now that you have set up Ory Elements with the App Router in your Next.js application, you can further customize the components,
182+ Now that you have set up Ory Elements with the Pages Router in your Next.js application, you can further customize the components,
167183add your own styles, and integrate them into your application as needed. You can also explore the Ory Elements documentation for
168184more information on how to use the components and customize them to fit your needs. See
169185[ Theming] ( ../../elements/guides/02_theming.mdx ) for more details on how to customize look and feel of the components.
0 commit comments