Skip to content
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

feat: add nextjs example and supporting libraries #240

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

aeneasr
Copy link
Member

@aeneasr aeneasr commented Oct 17, 2024

Related Issue or Design Document

Checklist

  • I have read the contributing guidelines and signed the CLA.
  • I have referenced an issue containing the design document if my change introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security vulnerability.
    If this pull request addresses a security vulnerability,
    I confirm that I got approval (please contact [email protected]) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation within the code base (if appropriate).

Further comments

Copy link
Member

@zepatrik zepatrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, but this triggered me during the presentation 😉

* project root. Assuming you have a file at `./app/my-login/page.tsx`, you would set this to
* `/my-login`.
*/
login_ui_path?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
login_ui_path?: string
loginUiPath?: string

* project root. Assuming you have a file at `./app/my-registration/page.tsx`, you would set this to
* `/my-registration`.
*/
registration_ui_path?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
registration_ui_path?: string
registrationUiPath?: string

* project root. Assuming you have a file at `./app/my-recovery/page.tsx`, you would set this to
* `/my-recovery`.
*/
recovery_ui_path?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
recovery_ui_path?: string
recoveryUiPath?: string

* project root. Assuming you have a file at `./app/my-verification/page.tsx`, you would set this to
* `/my-verification`.
*/
verification_ui_path?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
verification_ui_path?: string
verificationUiPath?: string

* project root. Assuming you have a file at `./app/my-settings/page.tsx`, you would set this to
* `/my-settings`.
*/
settings_ui_path?: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
settings_ui_path?: string
settingsUiPath?: string

@aeneasr
Copy link
Member Author

aeneasr commented Oct 18, 2024

🤣

@aeneasr
Copy link
Member Author

aeneasr commented Oct 18, 2024

@jonas-jonas why is it

import "@ory/elements-react/theme/styles.css"

and not

import "@ory/elements-react/theme/default/styles.css"

?

@aeneasr aeneasr closed this Oct 18, 2024
@aeneasr aeneasr reopened this Oct 18, 2024
@aeneasr
Copy link
Member Author

aeneasr commented Oct 18, 2024

I'm stuck trying to create the @ory/nextjs library and importing them in the two examples. Kinda lost here, would appreciate some help @jonas-jonas

@@ -0,0 +1,6 @@
import { OryConfig } from "./types"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonas-jonas basically this whole directory (examples/nextjs-app-router/nextjs) needs to be published as it's own @ory/nextjs package.

The package should only export things that are exported in the index.ts files

packages/nextjs/package.json Show resolved Hide resolved
@@ -0,0 +1,7 @@
import { getLoginFlow } from "./login"

export { getLoginFlow }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that @ory/nextjs/app has only the exports available in this file

@@ -0,0 +1,3 @@
import { OryCardContent } from "@ory/elements-react"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should actually be `OryCardLayout

Suggested change
import { OryCardContent } from "@ory/elements-react"
import { OryCardLayout } from "@ory/elements-react"


export function DefaultCardLayout({ children }: PropsWithChildren) {
return (
<main className="p-4 pb-8 flex items-center justify-center flex-col gap-8 min-h-screen">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem kinda is that we have the card element, but no backdrop element, so the card just is on the top left of the screen. We should add a layout component or background component. Not sure where to put it, so i put it here. But it's kinda weird because we don't override it anywhere, we just import it (see nextjs app router example app)

@jonas-jonas

This comment was marked as outdated.

@jonas-jonas jonas-jonas force-pushed the aeneasr/add-nextjs-app-router-example-2 branch from f3020b1 to 079ab44 Compare October 23, 2024 18:29
@jonas-jonas jonas-jonas force-pushed the aeneasr/add-nextjs-app-router-example-2 branch from 079ab44 to 8c3bc44 Compare October 30, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants