mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-09 23:35:09 -05:00
Add credentials: 'include' to chat completion fetch to enable cookie-based validation #5263
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @entanglesoftware on GitHub (May 21, 2025).
Summary
Update the chat modal so that AJAX (fetch) requests to
/api/chatincludecredentials: 'include'in the fetch options. This ensures cookies are sent with the request and allows backend validation using session or authentication cookies.Details
src/lib/components/chat/Chat.svelte, locate the function responsible for calling the chat completion endpoint (e.g.,generateChatCompletion)./api/chat(or equivalent) to includecredentials: 'include'.Example Change
Motivation
Some deployments require validation and authentication via cookies rather than only using bearer tokens. This change provides compatibility for such setups.
Impact
If you need this change for other endpoints as well, please specify!