ory / sdk

The place where ORY's SDKs are being auto-generated
Apache License 2.0
137 stars 85 forks source link

Possible error in ErrorBrowserLocationChangeRequired interface #302

Open tildadavillglas opened 8 months ago

tildadavillglas commented 8 months ago

Preflight checklist

Ory Network Project

No response

Describe the bug

Hello,

I believe there might be an error with how the ErrorBrowserLocationChangeRequired Typescript interface in the API SDK (for Typescript) is defined. Shouldn't it contain a GenericError instead of an ErrorGeneric, like other errors that can arise when fetching a flow?

That interface seems to be generated from here (relevant lines of code linked) and/or here in the Ory API SDK.

It's possible that I have misunderstood something about how these errors work, if so I apologize!

Reproducing the bug

Compare the documentation of errors associated with getting flows for user-facing self https://www.ory.sh/self-service/errors:

{
  error: {
    id: "browser_location_change_required",
    code: 422,
    status: "Unprocessable Entity",
    reason: "In order to complete this flow please redirect the browser to: /ui/login?flow=ad574ad7-1a3c-4b52-9f54-ef9e866f3cec",
    message: "browser location change required",
  },
  redirect_browser_to: "/ui/login?flow=ad574ad7-1a3c-4b52-9f54-ef9e866f3cec",
}

with the ErrorBrowserLocationChangeRequired Typescript interface that would look something like this implemented:

{
error: {
    error: {
        id: "browser_location_change_required",
        code: 422,
        status: "Unprocessable Entity",
        reason: "In order to complete this flow please redirect the browser to: /ui/login?flow=ad574ad7-1a3c-4b52-9f54-ef9e866f3cec",
        message: "browser location change required",
    },
    redirect_browser_to: "/ui/login?flow=ad574ad7-1a3c-4b52-9f54-ef9e866f3cec",
}

Relevant log output

None

Relevant configuration

None

Version

1.0.0 (@ory/kratos-client)

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response