[JS/TS SDK] inconsistent FrontendApi.createBrowserSettingsFlow
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 178
- Forks
- 96
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
When using the JS/TS SDK client @ory/client, behavior of createBrowserLogoutFlow and createBrowserSettingsFlow are inconsistent.
While calling createBrowserLogoutFlow without any args, the returned type is JSON, from which it is easy to extract logout_url.
When calling createBrowserSettingsFlow without any args, the API response is a 302 to the settings page, which is not handled correctly by the client leading to an exception. One must provide { headers: { accept: "application/json" } } for the code to complete successfully.
Reproducing the bug
const ory: FrontendApi = new FrontendApi(
new Configuration({
basePath: AUTH_ENDPOINT,
credentials: "include",
}),
);
const { logout_url } = await ory.createBrowserLogoutFlow();
const { request_url } = await ory.createBrowserSettingsFlow(); // => exception, invalid JSON
Relevant log output
Relevant configuration
Version
1.20.22
On which operating system are you observing this issue?
None
In which environment are you deploying?
None
Additional Context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated JS/TS FrontendApi entry points createBrowserLogoutFlow and createBrowserSettingsFlow, then reproduce both calls from the issue's TypeScript example. Compare their response handling, and consider the issue done when createBrowserSettingsFlow without arguments completes consistently instead of failing on invalid JSON.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100