chainlit
chainlit copied to clipboard
Authentication Failure in Copilot Mode: Missing Headers
I've been considering that anything related to tokens would likely utilize header_auth_callback(headers: Dict)
. I attempted to create a mock login (which guarantees authentication success regardless of the situation) to capture headers sent by the nginx reverse proxy. This approach works in app mode, but fails to receive headers in copilot mode, as illustrated in the attached screenshot:
mock login
App mode do return headers
Using the developer tools, I noticed an error message at index.js:78
, indicating an unauthorized access attempt:
GET http://localhost:8889/project/settings?language=zh-TW 401 (Unauthorized)
Copilot mode
App mode
This issue does not occur in app mode, only in copilot mode. The current problem is that I intend to use headers for authentication in copilot, but the server side does not receive any headers, thus failing to verify identity. Even with mock login (which should ensure authentication success), my simple HTML page displays an unauthorized access error.
Could you advise on how to resolve this issue? Thank you.