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

React and Preact example does not handle error code 422 #53

Closed
3 of 6 tasks
Benehiko opened this issue Nov 15, 2022 · 1 comment
Closed
3 of 6 tasks

React and Preact example does not handle error code 422 #53

Benehiko opened this issue Nov 15, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Benehiko
Copy link
Contributor

Benehiko commented Nov 15, 2022

Preflight checklist

Describe the bug

On flows that could result in an error with status code 422 we would want to redirect the user to that page or at least use some of the url data such as the flow id to retrieve the necessary data to complete the flow.

Example:

  1. Login flow is initialized
  2. User wants to login through webauthn
  3. API returns back an error with code 422 and a redirect_url
  4. React / Preact needs to redirect the user to the url / or catch the new flow id and get the new flow data in the background.
  5. User is presented a followup form with the correct data
  6. Submit login

Another place where this exists is Registration and Settings page with passwordless and oidc.

Reproducing the bug

Try link an oidc provider in the account settings page.

Additional Context

We have some functions covering this already:

@Benehiko Benehiko added the bug Something isn't working label Nov 15, 2022
@jgillich jgillich mentioned this issue Dec 22, 2022
6 tasks
misamu added a commit to misamu/ory-elements that referenced this issue Jan 18, 2023
misamu added a commit to misamu/ory-elements that referenced this issue Jan 18, 2023
* fix: Implement error handling

* refactor: Replicate function flow from react

* style: format
misamu added a commit to misamu/ory-elements that referenced this issue Jan 23, 2023
Benehiko pushed a commit that referenced this issue Jan 24, 2023
* fix: Error handling for react-spa 422 code (#53)

* style: format

* fix: format

* refactor: remove redundant promise returns

* feat: add basic error page

* feat: api call generic error handling

* fix: show error page on dashboard session errors

* fix: change default signupURL to /registration

* fix: create flow updates uri query param flow

* fix: format

* fix: show ui messages in view

* fix: sdk navigate target and options

* fix: remove debug
Benehiko added a commit that referenced this issue Jan 26, 2023
* fix: package.json build:preact script

* fix: Error handling for 422 code (#53)

* fix: Implement error handling

* refactor: Replicate function flow from react

* style: format

* fix: format

* feat: api call generic error handling

* feat: add basic error page

* fix: change default signupURL to /registration

* fix: change /signup to default kratos /registration

Co-authored-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>

Co-authored-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
@Benehiko
Copy link
Contributor Author

This can now be closed :)

Thank you @misamu!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant