fix(auth): make DISABLE_AUTH usable for /workspace#3297
Merged
waleedlatif1 merged 1 commit intosimstudioai:stagingfrom Feb 24, 2026
Merged
fix(auth): make DISABLE_AUTH usable for /workspace#3297waleedlatif1 merged 1 commit intosimstudioai:stagingfrom
waleedlatif1 merged 1 commit intosimstudioai:stagingfrom
Conversation
Return an anonymous session using the same response envelope as Better Auth's get-session endpoint, and make the session provider tolerant to both wrapped and raw session payloads. Fixes simstudioai#2524
|
@jayy-77 is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile SummaryThis PR fixes Key changes:
The fix ensures Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SessionProvider requests session] --> B{DISABLE_AUTH enabled?}
B -->|Yes| C[ensureAnonymousUserExists]
C --> D[createAnonymousGetSessionResponse]
D --> E[Return wrapped anonymous session]
B -->|No| F[Delegate to Better Auth handler]
F --> E
E --> G[extractSessionDataFromAuthClientResult]
G --> H{Response has data property?}
H -->|Yes| I[Extract from data envelope]
H -->|No| J{Response has user property?}
J -->|Yes| K[Use raw response]
J -->|No| L[Return null]
I --> M[Session loaded in provider]
K --> M
L --> M
Last reviewed commit: ee579b5 |
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
/workspaceby returning an anonymous session using the same response envelope as Better Auth’sget-sessionendpoint.{ data: ... }) and raw session payload shapes.Test plan
bun run test -- lib/auth/session-response.test.ts \"app/api/auth/[...all]/route.test.ts\"Fixes #2524