-
Notifications
You must be signed in to change notification settings - Fork 440
docs: add browser redirects configuration step and missing custom component instructions for Next.js quickstarts #2383
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
Open
wassimoo
wants to merge
1
commit into
master
Choose a base branch
from
wassimoo/nextjs-app-router-review
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,7 +101,23 @@ all files referenced as being in the `root` directory inside `src/` instead. | |
| src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-app-router/middleware.ts" | ||
| /> | ||
|
|
||
| 5. Create a new folder named `app` in the root of your project. Inside the `app` folder, create a new folder named `auth`. Inside | ||
| 5. Configure browser redirects in your Ory Console. Navigate to **Branding** > **Browser redirects** and set the **Global redirect | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have the |
||
| URL** to `/ui/welcome`. This ensures users are redirected to the correct page after completing authentication flows. | ||
|
|
||
|  | ||
|
|
||
| 6. Create a new folder named `components` in the root of your project. Inside the `components` folder, create a new file named | ||
| `custom-card-header.tsx` and add the following code: | ||
|
|
||
| <CodeFromRemote | ||
| lang="tsx" | ||
| title="components/custom-card-header.tsx" | ||
| src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-app-router/components/custom-card-header.tsx" | ||
| /> | ||
|
|
||
| This component is used by the Verification and Settings pages to customize the card header. | ||
|
|
||
| 7. Create a new folder named `app` in the root of your project. Inside the `app` folder, create a new folder named `auth`. Inside | ||
| the `auth` folder, create the following files: | ||
|
|
||
| - `login/page.tsx` | ||
|
|
@@ -155,7 +171,16 @@ all files referenced as being in the `root` directory inside `src/` instead. | |
| </Tabs> | ||
| ``` | ||
|
|
||
| 6. Run the application and create your first user by navigating to `/auth/registration`. After registration, you can log in at | ||
| 8. Use your own Ory Network project by setting the `ORY_SDK_URL` environment variable in your `.env` file: | ||
|
|
||
| ```mdx-code-block | ||
| <CodeFromRemote lang="bash" title=".env" src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-app-router/.env" /> | ||
| ``` | ||
|
|
||
| You can find your Ory Network project URL in the [**Get started**](https://console.ory.sh/projects/current/get-started) section | ||
| of the Ory Console. | ||
|
|
||
| 9. Run the application and create your first user by navigating to `/auth/registration`. After registration, you can log in at | ||
| `/auth/login`. You can also access the other self-service flows at the following URLs: | ||
|
|
||
| - Recovery: `/auth/recovery` | ||
|
|
@@ -189,15 +214,6 @@ all files referenced as being in the `root` directory inside `src/` instead. | |
|
|
||
| Open your browser and navigate to `http://localhost:3000/auth/registration` to create your first user. | ||
|
|
||
| 7. Optional: use your own Ory Network project by setting the `ORY_SDK_URL` environment variable in your `.env` file: | ||
|
|
||
| ```mdx-code-block | ||
| <CodeFromRemote lang="bash" title=".env" src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-app-router/.env" /> | ||
| ``` | ||
|
|
||
| You can find your Ory Network project URL in the [**Get started**](https://console.ory.sh/projects/current/get-started) section | ||
| of the Ory Console. | ||
|
|
||
| ## Next steps | ||
|
|
||
| Now that you have set up Ory Elements with the App Router in your Next.js application, you can further customize the components, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -64,7 +64,23 @@ The code used in the following quickstart is available in the | |||||
| src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-pages-router/middleware.ts" | ||||||
| /> | ||||||
|
|
||||||
| 4. Create a new folder named `pages` in the root of your project. Inside the `pages` folder, create a new folder named `auth`. | ||||||
| 4. Configure browser redirects in your Ory Console. Navigate to **Branding** > **Browser redirects** and set the **Global redirect | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| URL** to `/ui/welcome`. This ensures users are redirected to the correct page after completing authentication flows. | ||||||
|
|
||||||
|  | ||||||
|
|
||||||
| 5. Create a new folder named `components` in the root of your project. Inside the `components` folder, create a new file named | ||||||
| `custom-card-header.tsx` and add the following code: | ||||||
|
|
||||||
| <CodeFromRemote | ||||||
| lang="tsx" | ||||||
| title="components/custom-card-header.tsx" | ||||||
| src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-app-router/components/custom-card-header.tsx" | ||||||
| /> | ||||||
|
|
||||||
| This component is used by the Verification and Settings pages to customize the card header. | ||||||
|
|
||||||
| 6. Create a new folder named `pages` in the root of your project. Inside the `pages` folder, create a new folder named `auth`. | ||||||
| Inside the `auth` folder, create the following files: | ||||||
|
|
||||||
| - `login.tsx` | ||||||
|
|
@@ -118,7 +134,16 @@ The code used in the following quickstart is available in the | |||||
| </Tabs> | ||||||
| ``` | ||||||
|
|
||||||
| 5. Run the application and create your first user by navigating to `/auth/registration`. After registration, you can log in at | ||||||
| 7. Use your own Ory Network project by setting the `ORY_SDK_URL` environment variable in your `.env` file: | ||||||
|
|
||||||
| ```mdx-code-block | ||||||
| <CodeFromRemote lang="bash" title=".env" src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-pages-router/.env" /> | ||||||
| ``` | ||||||
|
|
||||||
| You can find your Ory Network project URL in the [**Get started**](https://console.ory.sh/projects/current/get-started) section | ||||||
| of the Ory Console. | ||||||
|
|
||||||
| 8. Run the application and create your first user by navigating to `/auth/registration`. After registration, you can log in at | ||||||
| `/auth/login`. You can also access the other self-service flows at the following URLs: | ||||||
|
|
||||||
| - Recovery: `/auth/recovery` | ||||||
|
|
@@ -152,18 +177,9 @@ The code used in the following quickstart is available in the | |||||
|
|
||||||
| Open your browser and navigate to `http://localhost:3000/auth/registration` to create your first user. | ||||||
|
|
||||||
| 6. Optional: use your own Ory Network project by setting the `ORY_SDK_URL` environment variable in your `.env` file: | ||||||
|
|
||||||
| ```mdx-code-block | ||||||
| <CodeFromRemote lang="bash" title=".env" src="https://raw.githubusercontent.com/ory/elements/refs/heads/main/examples/nextjs-pages-router/.env" /> | ||||||
| ``` | ||||||
|
|
||||||
| You can find your Ory Network project URL in the [**Get started**](https://console.ory.sh/projects/current/get-started) section | ||||||
| of the Ory Console. | ||||||
|
|
||||||
| ## Next steps | ||||||
|
|
||||||
| Now that you have set up Ory Elements with the App Router in your Next.js application, you can further customize the components, | ||||||
| Now that you have set up Ory Elements with the Pages Router in your Next.js application, you can further customize the components, | ||||||
| add your own styles, and integrate them into your application as needed. You can also explore the Ory Elements documentation for | ||||||
| more information on how to use the components and customize them to fit your needs. See | ||||||
| [Theming](../../elements/guides/02_theming.mdx) for more details on how to customize look and feel of the components. | ||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.