fix(auth): recover cleanly when an impersonation session expires#5692
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Adds Extracts Session query changes apply only while Reviewed by Cursor Bugbot for commit d675f0b. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
@greptile review |
Greptile SummaryThis PR adds clean recovery when an impersonation session expires. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (4): Last reviewed commit: "fix(auth): share stale-session recovery ..." | Re-trigger Greptile |
Greptile SummaryThis PR adds recovery for expired impersonation sessions. The main changes are:
Confidence Score: 4/5The impersonation recovery path can still miss expiry or restart the login/workspace loop.
apps/sim/hooks/queries/session.ts and apps/sim/app/workspace/[workspaceId]/components/impersonation-banner/impersonation-expired.tsx Important Files Changed
Reviews (2): Last reviewed commit: "fix(auth): recover cleanly when an imper..." | Re-trigger Greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ 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 d675f0b. Configure here.
|
@greptile review |
Summary
impersonatedByis set — normal sessions are unaffectedcustomSessionplugin drops the cookie-deletion headers on nullget-sessionresponses), so the middleware bounces/loginback to/workspaceand the clean-null branch spins forever. That branch now recovers throughrecoverFromStaleSession()(sign-out clears the cookies without needing a live session) instead of a barereplace('/login')Type of Change
Testing
Tested manually end to end in the browser: impersonate → forced expiry → auto sign-out → login, and refresh-after-expiry no longer loops (reproduced the loop on current staging first). tsc, lint, and check:api-validation:strict pass.
Checklist