-
Notifications
You must be signed in to change notification settings - Fork 13k
fix: update /v1/users.logout to properly log out all user sessions #37846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
🦋 Changeset detectedLatest commit: 7d51add The changes in this PR will be included in the next version bump. This PR includes changesets to release 42 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughAdds a Sessions.logoutAllByUserId method and invokes it from the server logout route so sessions receive a logoutAt/logoutBy update when tokens are removed, ensuring sessions are marked as invalidated. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.{ts,tsx,js}📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)
Files:
🧠 Learnings (3)📚 Learning: 2025-09-19T15:15:04.642ZApplied to files:
📚 Learning: 2025-11-04T16:49:19.107ZApplied to files:
📚 Learning: 2025-10-28T16:53:42.761ZApplied to files:
🧬 Code graph analysis (1)apps/meteor/app/api/server/v1/users.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37846 +/- ##
========================================
Coverage 67.70% 67.71%
========================================
Files 3475 3475
Lines 113861 113903 +42
Branches 20942 21003 +61
========================================
+ Hits 77093 77124 +31
- Misses 34586 34594 +8
- Partials 2182 2185 +3
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
lucas-a-pelegrino
left a comment
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.
BE looks good.
As per CORE-1364, the general logout endpoint does not update the
sessionscollection, causing logged-out devices to remain visible in Manage Devices page.Proposed changes (including videos or screenshots)
A new
Sessions.logoutAllByUserId(userId, logoutBy)method was introduced, which setslogoutAtandlogoutByfor all active sessions of the user. The/v1/users.logoutendpoint now calls this method after removing login tokens, ensuring session state is consistently updated across the system.Issue(s)
Steps to test or reproduce
/api/v1/users.logoutBefore the fix:
After the fix:
Summary by CodeRabbit
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.