fix(auth): Redirect to login if user session doesn't exist#4497
fix(auth): Redirect to login if user session doesn't exist#4497TheodoreSpeaks merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview After enforcing the session presence, it simplifies org ID extraction by removing optional chaining on Reviewed by Cursor Bugbot for commit f81eba9. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR fixes a blank-screen bug that occurs when an admin impersonates a user, forgets to log out, and later revisits the app with an expired session cookie — by extending the impersonation session lifetime from the default to 100 years.
Confidence Score: 3/5The change trades a real UX regression for a permanent impersonation session that has no natural expiry — the blank-screen bug is not fixed at its source. The only changed line makes impersonation sessions last 100 years. Any impersonation token that is leaked — via XSS, server logs, network capture, or a compromised device — will remain valid indefinitely. The original blank-screen problem stems from the app not handling an expired session gracefully; removing the expiry boundary is a workaround that avoids the symptom without fixing the underlying redirect/error-handling logic. apps/sim/lib/auth/auth.ts — the impersonation session duration and the session-expiry handling path that triggers the blank screen.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/auth/auth.ts | Impersonation session duration increased from default to 100 years (3,153,600,000 s), making impersonation tokens effectively non-expiring and widening the blast radius of any token leak. |
Reviews (1): Last reviewed commit: "feat(admin): Increase impersonation time..." | Re-trigger Greptile
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9d4bf16. Configure here.
…ng blank workspace

Summary
/workspace/[workspaceId]/..., the page rendered blank — the layout fetched the session but never handled the null case, so client hooks below it ran with no auth and produced empty UI.Type of Change
Testing
Tested manually.
bun run lintandbun run check:api-validation:strictpass.Checklist