-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Bug Report: Invalid Authentication Token Errors After Logout #2868
Description
Describe the bug
When logging out from a Chainlit application, the UI repeatedly displays errors stating "Invalid authentication token". In the browser’s DevTools console, these appear as recurring 401 Unauthorized network errors.
The logout itself is successful — the user session ends correctly — but the application continues trying to call authenticated endpoints every ~15 seconds, causing a flood of errors.
To Reproduce
Steps to reproduce the behavior:
- Open the Chainlit application.
- Log in with a valid user.
- Click Logout.
- Observe UI error toasts stating "Invalid authentication token".
- Open DevTools → Network tab → see recurring 401 Unauthorized requests continuing even after logout.
Expected behavior
After logging out:
The UI should stop making authenticated API calls.
No error toasts or console errors should appear.
Any background polling, websocket, or refresh loops should be terminated on logout.
Screenshots
imgur screenshots
Desktop (please complete the following information):
- OS: Windows
- Browser: Microsoft Edge
- Version: 146.0.3856.84 (Official build) (64‑bit)
- Device: Notebook
Additional context
The issue occurs consistently.
Requests continue to fire approximately every ~15 seconds in debug mode, suggesting that a background polling loop or web-socket reconnect attempts are not being cleaned up upon logout.
The logout endpoint works correctly — the user session ends — but the UI continues behaving as if still logged in and attempting protected API calls with an expired/invalid token.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status