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

Incorrect HTTP code when attempting to create a recovery link for non-existing user #3848

Open
3 of 5 tasks
constantoine opened this issue Mar 25, 2024 · 2 comments
Open
3 of 5 tasks
Labels
bug Something is not working.

Comments

@constantoine
Copy link

Preflight checklist

Ory Network Project

No response

Describe the bug

Upon calling the /admin/recovery/link route with an identity_id that does not exist, an HTTP 400 status code is sent back, when a 404 is what would have been expected (As the OpenAPI would have let think that this route can indeed return a 404 error.

This seems to be related to #1664 except there seems to be a discrepancy between the issue (returning a 404 error when the body is invalid, because the identity_id would be empty and as such not correspond to an existing identity) and what the fix actually did (if an identity is not found, return a 400)

Reproducing the bug

  • Make API request on /admin/recovery/link with an identity_id value that does not match an existing identity
  • Receive a 400 with error.reason field being set to The requested identity id does not exist.

Relevant log output

No response

Relevant configuration

No response

Version

0.13

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response

@constantoine constantoine added the bug Something is not working. label Mar 25, 2024
@alnr
Copy link
Contributor

alnr commented Mar 28, 2024

What is the problem, exactly? Returning 400 here for an identity ID which does not exist seems OK to me semantically. The OpenAPI spec also lists 400 as a possible error code.

@constantoine
Copy link
Author

As the spec lists 404 as a possible error, and because it's not documented in the OpenAPI what cases cause what error, it is just something we assumed

Are there cases that can trigger a 404?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants