Open thiagotps opened 1 day ago
I found a similar issue related to "Invalid authentication token" errors when rendering images in a Chainlit application with authentication enabled. This error often occurs if the JWT secret is missing or incorrect. To resolve this, ensure that the CHAINLIT_AUTH_SECRET
environment variable is set correctly. You can generate a JWT secret using the command chainlit create-secret
and set it in your environment [1].
Additionally, make sure that the token used in requests is valid and correctly included in the Authorization
header when accessing resources that require authentication [1].
To continue talking to Dosu, mention @dosu.
This is a bug introduced with Chainlit 1.3. It's still there in Chainlit 1.3.1.
In reqirements.txt set chainlit==1.2.0 and you'll be good to go till resolved.
I love this framework, but I burnt so much time on this, lesson learned, be very specific with version in the requirements rather than allowing a range of versions for this fast moving project :(
Cheers Dave
Describe the bug When there is no authentication, images sent in the chat are rendered normally. But with authentication set up, images sent over the chat are not rendered by the browser, receiving a 401 error with message
when accessed.
To Reproduce Just try to send an image to the chat of the chainlit app executed through the following command
with the following code
Expected behavior I expect to see the image being rendered normally.
Screenshots And when trying to directly open the image with the http://localhost:8000/project/file/e9901e54-7210-468b-8ebb-218426bbf5f9?session_id=a9d63b80-0432-4e98-8fb6-5bde5a83d11b link:
Desktop (please complete the following information):
Additional context chainlit version is 1.3.0