-
Notifications
You must be signed in to change notification settings - Fork 403
feat: identities getting started #2103
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
base: master
Are you sure you want to change the base?
Conversation
TODO:
|
Feedback from @piotrmsc
|
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.
Structurally it's going in the right direction, but I think we need a bit more work on the content side!
- How to implement registration and login forms | ||
- How to handle redirects and CSRF protection |
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.
These seem to be missing?
|
||
```tsx | ||
export default function Page() { | ||
const [session, setSession] = useState<Session | null>(null) |
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.
I am following the guide "step by step" and it does not explain on which port my app should run, which modules beside ory client I should use and the config code example is broken.
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.
I am using latest preview deployment https://docs-gqucrqdpp-ory.vercel.app/docs/identities/get-started/setup#3-configure-the-sdk
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.
I am making some assumptions about the reader. If a reader is on this pages, they have a language/framework of choice which means they are familiar with that language/framework. Providing every context will bloat the example snippets. The only context that is required is the ory SDK stuff but language specific context are assumed about the reader.
Following again blindly "step by step" : When I try logout I am getting 404 after logout call as well, in ory tunnel I see calls and redirects but in the end I end up with 404 from CF blocking rule, do I need to configure something extra? |
const requireAuth = async (req, res, next) => { | ||
try { | ||
const session = await ory.toSession({ cookie: req.header("cookie") }) | ||
req.session = session | ||
next() | ||
} catch (error) { | ||
res.redirect(`${process.env.ORY_SDK_URL}/self-service/login/browser`) | ||
} | ||
} | ||
|
||
app.get("/", requireAuth, (req, res) => { | ||
res.json(req.session.identity.traits) // { email: '[email protected]' } | ||
}) |
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.
can this be re-used already in sign in /sign up example? you are also partially doing it in /
handler for registration.
To start the account recovery flow, send the user to the recovery page: | ||
|
||
```html | ||
<a href="$ORY_SDK_URL/self-service/recovery/browser">Recover your account</a> |
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.
if we have node example shouldn't this be covered also with code example for consistency ?
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.
I agree. This should be wrapped in a code example
Related Issue or Design Document
Checklist
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.
Further comments