chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

Bug: On Logging-Screen for password authentication, the error message for incorrect credentials is missing or just the default.

Open alexander-lux-solvatio opened this issue 9 months ago • 0 comments

Describe the bug On Logging-Screen for password authentication, the error message for incorrect credentials is missing or just the default. Expected would be the error message for the translation key "auth.errors.credentialsSignin"

To Reproduce Steps to reproduce the behavior:

  1. create a password authentication hook.
  2. start chainlit => Login-Screen is shown
  3. enter incorrect credentials => no error message or error message auth.errors.default is displayed

Expected behavior I would expect the error message for the translation key "auth.errors.credentialsSignin" to be displayed

Additional context I already did some analysis and I'm pretty sure about the root cause. Here https://github.com/Chainlit/chainlit/blob/bc292f69875f01dd239f1a9c072324c1f3febe66/frontend/src/components/LoginForm.tsx#L67 the LoginForm reads the message of the error, and uses this to lookup the translation. But when the error is created in the fetch function https://github.com/Chainlit/chainlit/blob/bc292f69875f01dd239f1a9c072324c1f3febe66/libs/react-client/src/api/index.tsx#L143 this message is the statusTxt, while the actual reason (in this case credentialsSignin), is passed as "detail". So probably the fix is to read the detail in the LoginForm instead of the error message, in the case where the Error is a ClientError

alexander-lux-solvatio avatar Feb 18 '26 13:02 alexander-lux-solvatio