ory / ory/network

Settings flow does not respect the return_to with a `/settings` path

Open
#321 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Shell
Stars
96
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Preflight checklist
Describe the bug

A settings flow containing a return_to with the /settings path causes return_to to be ignored in the settings submit flow. An example is when you have an application with the url https://app.example.com/settings the URL will look like so:

https://auth.example.com/sefl-service/settings/browser?return_to=https://app.example.com/settings.

The project config has the following:

Custom Domain: auth.example.com
Custom UI: ui.example.com
Settings URL: /settings

note: this only happens with Custom domains and not when developing locally through the Ory tunnel

Reproducing the bug
  1. Create a project
  2. Add custom domain
  3. Add your custom UI base URL
  4. Keep the settings UI as a relative path /settings
  5. Initiate a settings flow with the return_to query parameter set to a route containing /settings in the path (https://app.example.com/settings)
  6. Submit the settings flow and see it stay on the settings page.
Relevant log output

No response

Relevant configuration

No response

Version

latest

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

No files, tests, or entry points are named. Reproduce the settings flow with a custom domain, a relative settings UI path, and return_to pointing to a URL containing /settings; trace how the settings submission handles that value. Done means submission redirects to the supplied return_to URL instead of remaining on the settings page.

Written by the indexing model from the issue text.

Assessment

Domain
authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.