Bug: On Logging-Screen for password authentication, the error message for incorrect credentials is missing or just the default.
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:
- create a password authentication hook.
- start chainlit => Login-Screen is shown
- 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