GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: double wrap reponse of guest session handler by stylessh · Pull Request #4438 · simstudioai/sim

Conversation

@stylessh

@stylessh stylessh commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

createAnonymousGetSessionResponse was wrapping the session in { data: ... }, but the better-auth client adds that wrapper itself — so the client was seeing { data: { data: { user, session } } } and failing to find user. Returning the raw session object fixes the double-wrap.

Fixes #(issue)

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

Run locally and disable auth. You'll get a blank page on load.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
waleedlatif1 and others added 30 commits April 3, 2026 23:30
@waleedlatif1
v0.6.23: MCP fixes, remove local state in favor of server state, moth…
0b9019d
…ership workflow edits via sockets, ui improvements
@waleedlatif1
v0.6.24: copilot feedback wiring, captcha fixes
a54dcbe
@waleedlatif1
v0.6.25: cloudwatch, cloudformation, live kb sync, linear fixes, post…
28af223
…hog upgrade
@waleedlatif1
v0.6.26: ui improvements, multiple response blocks, docx previews, ol…
d889f32
…lama fix
@waleedlatif1
v0.6.27: new triggers, mothership improvements, files archive, queuei…
316bc8c
…ng improvements, posthog, secrets mutations
@waleedlatif1
v0.6.28: new docs, delete confirmation standardization, dagster integ…
3f508e4
…ration, signup method feature flags, SSO improvements
@TheodoreSpeaks
v0.6.29: login improvements, posthog telemetry (simstudioai#4026)
d6ec115
* feat(posthog): Add tracking on mothership abort (simstudioai#4023)

Co-authored-by: Theodore Li <[email protected]>

* fix(login): fix captcha headers for manual login  (simstudioai#4025)

* fix(signup): fix turnstile key loading

* fix(login): fix captcha header passing

* Catch user already exists, remove login form captcha
@waleedlatif1
v0.6.30: slack trigger enhancements, connectors performance improveme…
d7da35b
…nts, secrets performance, polling refactors, drag resources in mothership
@waleedlatif1
v0.6.31: elevenlabs voice, trigger.dev fixes, cloud whitelabeling for…
cf233bb
… enterprises
@waleedlatif1
v0.6.32: BYOK fixes, ui improvements, cloudwatch tools, jsm tools ext…
f8f3758
…ension
@waleedlatif1
v0.6.33: polling improvements, jsm forms tools, credentials reactquer…
3c8bb40
…y invalidation, HITL docs
@waleedlatif1
v0.6.34: trigger.dev fixes, CI speedup, atlassian error extractor
d33acf4
@waleedlatif1
v0.6.35: additional jira fields, HITL docs, logs cleanup efficiency
4f40c4c
@waleedlatif1
v0.6.36: new chunkers, sockets state machine, google sheets/drive/cal…
cbfab1c
…endar triggers, docs updates, integrations/models pages improvements
@waleedlatif1
v0.6.37: audit logs page, isolated-vm worker rotation, permission gro…
4309d06
…ups ui
@waleedlatif1
v0.6.38: models page
8b57476
@waleedlatif1
v0.6.39: billing fixes, tools audit, landing fix
e3d0e74
@waleedlatif1
v0.6.40: mothership tool loop, new skills, agiloft, STS, IAM integrat…
0ac0539
…ions, jira forms endpoints
@waleedlatif1
v0.6.41: webhooks fix, workers removal
3838b6e
@waleedlatif1
v0.6.42: mothership nested file reads, search modal improvements
fc07922
@waleedlatif1
v0.6.43: mothership billing idempotency, env var resolution fixes
3a1b1a8
@waleedlatif1
v0.6.44: streamdown, mothership intelligence, excel extension
46ffc49
@Sg312
v0.6.45: superagent, csp, brightdata integration, gemini response for…
010435c
…mat, logs performance improvements

fix(csp): add missing analytics domains, remove unsafe-eval, fix workspace CSP gap (simstudioai#4179)
fix(landing): return 404 for invalid dynamic route slugs (simstudioai#4182)
improvement(seo): optimize sitemaps, robots.txt, and core web vitals across sim and docs (simstudioai#4170)
fix(gemini): support structured output with tools on Gemini 3 models (simstudioai#4184)
feat(brightdata): add Bright Data integration with 8 tools (simstudioai#4183)
fix(mothership): fix superagent credentials (simstudioai#4185)
fix(logs): close sidebar when selected log disappears from filtered list; cleanup (simstudioai#4186)
@icecrasher321
Merge pull request simstudioai#4190 from simstudioai/staging
c0bc62c
v0.6.46: mothership streaming fixes, brightdata integration
@waleedlatif1
v0.6.46: mothership queueing, web vitals
387cc97
@waleedlatif1
v0.6.47: files focusing, documentation, opus 4.7
2dbc7fd
@waleedlatif1
v0.6.48: import csv into tables, subflow fixes, CSP updates
8a50f18
@waleedlatif1
v0.6.49: deploy sockets event, resolver, logs improvements, monday.co…
dcf3302
…m integration, atlassian triggers
@icecrasher321
v0.6.50: ppt/doc/pdf worker isolation, docs, chat, sidebar improvements
bc09865
@waleedlatif1
v0.6.51: tables improvements, billing fixes, 404 pages, code hygiene
5f56e46
icecrasher321 and others added 16 commits April 21, 2026 22:11
@icecrasher321
Merge pull request simstudioai#4261 from simstudioai/staging
7c619e7
v0.6.54: migration error logs
@icecrasher321
v0.6.54: mothership tracing, db pool size increase
64cfda5
@waleedlatif1
v0.6.55: standardize monorepo conventions, api key hash, thinking tex…
7ca736a
…t for mothership
@waleedlatif1
v0.6.56: data retention improvements, tables column double click resi…
6066fc1
…ze, subagent thinking, files sorting, agentphone integration
@waleedlatif1
Merge pull request simstudioai#4285 from simstudioai/staging
3422f64
fix(db): revert statement_timeout startup options breaking pooled connections (simstudioai#4284)
@TheodoreSpeaks
Merge pull request simstudioai#4293 from simstudioai/staging
595c4c3
v0.6.57: mothership reliability, ashby refactor, tables row count, copilot id fix, bun upgrade
@icecrasher321
v0.6.58: queue abort state machine improvement, contributing guide
d6c1bc2
@icecrasher321
v0.6.59: gpt 5.5, security hardening, parallel subagents rendering
58a3ae2
@icecrasher321
v0.6.60: copilot security improvements, slack canvas ops, retention j…
489f2d3
…obs fixes
@icecrasher321
v0.6.61: SAP integration, live URLs for browser use, 5xx error catego…
6aa3fe3
…rizations, mothership positional table row insertion, CI improvements, org-external users, file viewer improvements
@TheodoreSpeaks
Merge pull request simstudioai#4342 from simstudioai/staging
ecbf5e5
v0.6.62: fix new copilot chat creation and selection on refresh
@waleedlatif1
v0.6.62: firecrawl parse, new gmail tools, trace improvements, tool f…
2aaf2b7
…ixes, db query optimizations, contract boundaries code hygiene, CORS, toast improvements, tables infinite query, executor robustness, reranker support
@waleedlatif1
v0.6.63: knowledgebase UI, folder search in mothership
d445b9c
@waleedlatif1
v0.6.64: table limits env vars, workspace files improvements, integra…
4bc6a17
…tion blocks/connectors updates
@waleedlatif1
v0.6.65: memory fix, image uploads in files
5be12f8
@stylessh
fix double wrap reponse of guest session handler
fb0c7c5
@vercel

vercel Bot commented May 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped May 4, 2026 9:02pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot temporarily deployed to Preview May 4, 2026 20:52 Inactive
@cursor

cursor Bot commented May 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes the get-session response shape when DISABLE_AUTH is enabled, which could affect clients relying on the previous (incorrect) envelope despite being a targeted fix.

Overview
Fixes the DISABLE_AUTH GET /api/auth/get-session path to return the raw anonymous session object via createAnonymousSession() instead of wrapping it in an extra { data: ... } layer.

Removes the now-redundant createAnonymousGetSessionResponse() helper and updates route tests/mocks to assert the corrected response shape.

Reviewed by Cursor Bugbot for commit 1c327da. Configure here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented May 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

The get-session route for disabled-auth mode was returning { data: { user, session } } via createAnonymousGetSessionResponse, but the better-auth client applies its own data envelope, resulting in { data: { data: { user, session } } } and a missing-user failure. This PR fixes the double-wrap by calling createAnonymousSession() directly in NextResponse.json(...) and removes the now-redundant wrapper function entirely. Tests are updated to assert the corrected flat shape.

Confidence Score: 5/5

Safe to merge — minimal, well-targeted fix with corresponding test updates and no regressions.

The change is a one-function deletion and a single call-site update. The root cause (double wrapping) is clearly explained, the fix is correct, tests are updated, and no other callers of the removed function exist.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/app/api/auth/[...all]/route.ts Route now returns NextResponse.json(createAnonymousSession()) directly, eliminating the double data-wrap seen by the better-auth client.
apps/sim/lib/auth/anonymous.ts Removes the now-unnecessary createAnonymousGetSessionResponse wrapper function; createAnonymousSession is used directly by the route.
apps/sim/app/api/auth/[...all]/route.test.ts Test mock updated to use createAnonymousSession and expected JSON shape corrected to flat { user, session } without the extra data wrapper.

Sequence Diagram

sequenceDiagram
    participant Client as better-auth Client
    participant Route as GET /api/auth/get-session
    participant Anon as createAnonymousSession()

    Note over Client,Anon: BEFORE fix (double-wrap)
    Client->>Route: GET /api/auth/get-session
    Route->>Anon: createAnonymousGetSessionResponse()
    Anon-->>Route: { data: { user, session } }
    Route-->>Client: NextResponse.json({ data: { user, session } })
    Client->>Client: wraps in data → { data: { data: { user, session } } } ❌

    Note over Client,Anon: AFTER fix (single-wrap)
    Client->>Route: GET /api/auth/get-session
    Route->>Anon: createAnonymousSession()
    Anon-->>Route: { user, session }
    Route-->>Client: NextResponse.json({ user, session })
    Client->>Client: wraps in data → { data: { user, session } } ✅
Loading

Reviews (2): Last reviewed commit: "remove dead code, and fix test" | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 4, 2026
View reviewed changes
Comment thread apps/sim/app/api/auth/[...all]/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread apps/sim/app/api/auth/[...all]/route.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@stylessh
remove dead code, and fix test
1c327da
@vercel
vercel Bot temporarily deployed to Preview May 4, 2026 21:02 Inactive
@waleedlatif1

waleedlatif1 commented May 4, 2026

Copy link
Copy Markdown
Collaborator

@cursor review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1

waleedlatif1 commented May 4, 2026

Copy link
Copy Markdown
Collaborator

@greptile

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cursor[bot]
cursor Bot reviewed May 4, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1c327da. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waleedlatif1
waleedlatif1 changed the base branch from main to staging May 4, 2026 22:49
@gitguardian

gitguardian Bot commented May 4, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
29606901 Triggered Generic High Entropy Secret a54dcbe apps/sim/providers/utils.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider

  • following these best practices for managing and storing secrets including API keys and other credentials
  • install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@icecrasher321
icecrasher321 merged commit 1dc6f7d into simstudioai:staging May 4, 2026
13 of 14 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1 waleedlatif1 mentioned this pull request May 5, 2026
v0.6.66: child trace spans, reranker controls, attachment previews, logs block, parallel-in-loop wall clock, gpt-image-2 #4444
Merged

This branch was previously deployed

1 inactive deployment
Preview — 1c327da8 Deployed May 4, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@stylessh @waleedlatif1 @icecrasher321 @TheodoreSpeaks @Sg312
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.