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

error.response.data.error.id does not exist #246

Open
3 of 5 tasks
ysds opened this issue Oct 23, 2024 · 0 comments
Open
3 of 5 tasks

error.response.data.error.id does not exist #246

ysds opened this issue Oct 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ysds
Copy link

ysds commented Oct 23, 2024

Preflight checklist

Ory Network Project

No response

Describe the bug

I'm using Ory Network and have encountered an issue with error handling in the example code.

The condition in this file:

if (error.response.data?.error?.id === "session_already_available") {

suggests that error.response.data.error.id might exist. Similar conditions appear multiple times in the same file.

However, in practice, error.response.data.error does not exist. It's unclear whether this is an issue with Ory Network or if the condition itself is incorrect.

image

When cloning this repository and testing it with an Ory Network project, I observed that:

  1. error.response.data.error does not exist.
  2. In the case of "session_already_available", it's expected to redirect to the root, but instead, an error message is displayed: "A valid session was detected and thus login is not possible. Did you forget to set ?refresh=true?"
image

How should we correctly handle different error scenarios based on the error ID?

Could you please clarify:

  1. The correct structure of the error object returned by Ory Network.
  2. The proper way to handle different error types, especially the "session_already_available" case.

Reproducing the bug

  1. Launch the react-spa example from this repository.
  2. Use an Ory Network project for authentication.
  3. Open the login screen in two separate browser tabs.
  4. Log in successfully on one tab.
  5. Attempt to log in on the second tab.

Expected Behavior:
The user should be redirected to the "Welcome to the dashboard!" page on the second tab.

Actual Behavior:
An error message "A valid session was detected and thus login is not possible. Did you forget to

Relevant log output

No response

Relevant configuration

No response

Version

Ory Network

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

@ysds ysds added the bug Something isn't working label Oct 23, 2024
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