kratos icon indicating copy to clipboard operation
kratos copied to clipboard

User-friendly error messages for Kratos API endpoint 400 responses

Open RubenWerdmuller opened this issue 3 years ago • 1 comments

Preflight checklist

Describe the bug

When calling the Kratos adminCreateIdentity endpoint, the 400 response error messages are not quite user-readable.

For example, having an email in the identity schema, mark is required and filling it as an empty string produces the following response:

code: 400
message: "The request was malformed or contained invalid parameters"
reason: "I[#/traits/email] S[#/properties/traits/properties/email/format] "" is not valid "email""
request: "1c475a8b6751ddc7ee6ced7232a13449"

Also, see this conversation on Slack: https://ory-community.slack.com/archives/C02PSRUGUAV/p1660570115446989

Version

Helm chart 0.23.1 and Kratos v0.9.0-alpha.3

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

Kubernetes with Helm

Additional Context

A proposed solution is to re-use the code that creates the error messages for other flows and insert it for all relevant Kratos endpoints. For example, when using the kratos-self-service-UI-react-next, the <Flow/> component already receives and presents these messages user-friendly.

RubenWerdmuller avatar Aug 15 '22 13:08 RubenWerdmuller

Good point, we for sure need to improve this!

aeneasr avatar Aug 15 '22 15:08 aeneasr

Any updates on this particular issue? 🚢

RubenWerdmuller avatar Jun 27 '23 11:06 RubenWerdmuller