ory / ory/sdk

Possible error in ErrorBrowserLocationChangeRequired interface

Open
#302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
178
Forks
96
Avg merge
6d 23h
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing ErrorBrowserLocationChangeRequired in clients/kratos/typescript/api.ts and clients/client/typescript/api.ts with the documented self-service flow error. Trace the generated interface back through the referenced SDK definitions, then verify that the error shape and generated TypeScript output match the documented response.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.