Originally created by @entanglesoftware on GitHub (May 21, 2025).
Summary
Update the chat modal so that AJAX (fetch) requests to /api/chat include credentials: 'include' in the fetch options. This ensures cookies are sent with the request and allows backend validation using session or authentication cookies.
Details
In src/lib/components/chat/Chat.svelte, locate the function responsible for calling the chat completion endpoint (e.g., generateChatCompletion).
Update the fetch call to /api/chat (or equivalent) to include credentials: 'include'.
This enables cookies to be sent along with the AJAX request, supporting validation and authentication on the backend.
Some deployments require validation and authentication via cookies rather than only using bearer tokens. This change provides compatibility for such setups.
Impact
Only the fetch request for chat completion is affected.
No breaking changes; authentication via headers will still work.
If you need this change for other endpoints as well, please specify!
Originally created by @entanglesoftware on GitHub (May 21, 2025).
## Summary
Update the chat modal so that AJAX (fetch) requests to `/api/chat` include `credentials: 'include'` in the fetch options. This ensures cookies are sent with the request and allows backend validation using session or authentication cookies.
## Details
- In `src/lib/components/chat/Chat.svelte`, locate the function responsible for calling the chat completion endpoint (e.g., `generateChatCompletion`).
- Update the fetch call to `/api/chat` (or equivalent) to include `credentials: 'include'`.
- This enables cookies to be sent along with the AJAX request, supporting validation and authentication on the backend.
### Example Change
```diff
fetch('/api/chat', {
method: 'POST',
headers: { ... },
body: JSON.stringify(payload),
+ credentials: 'include'
})
```
## Motivation
Some deployments require validation and authentication via cookies rather than only using bearer tokens. This change provides compatibility for such setups.
## Impact
- Only the fetch request for chat completion is affected.
- No breaking changes; authentication via headers will still work.
---
If you need this change for other endpoints as well, please specify!
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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!