fix(web): send session cookies on playground/agent generate requests#5703
Open
Taranum01 wants to merge 1 commit into
Open
fix(web): send session cookies on playground/agent generate requests#5703Taranum01 wants to merge 1 commit into
Taranum01 wants to merge 1 commit into
Conversation
Self-hosted Better Auth requires the session cookie on cross-origin Jawn calls; the Playground generate path omitted credentials: include unlike getJawnClient(), causing Invalid session on /v1/playground/generate. Fixes Helicone#5653 Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Someone is attempting to deploy a commit to the Helicone Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
credentials: "include"to the Playground/Agentgenerate()fetch so Better Auth session cookies reach Jawn on cross-origin self-hosted deployments (localhost:3000→:8585).params.signaltofetchso streaming cancel works as intended.Closes #5653
Problem
Self-hosted Playground returns
401 Invalid sessiononPOST /v1/playground/generateeven when the user is logged in. Other dashboard Jawn calls succeed because they usegetJawnClient(), which always sendscredentials: "include". The Playground path uses a rawfetch()without credentials, so the session cookie is omitted andBetterAuthWrapper.getSession()fails.Test plan
Invalid session/v1/agent/generate) works in self-hosted Better Auth modeMade with Cursor