fix: clean up OAuth tokens after user deactivation#40633
fix: clean up OAuth tokens after user deactivation#40633dionisio-bot[bot] wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 3a524d4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
There was a problem hiding this comment.
1 issue found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/meteor/app/api/server/v1/users.ts">
<violation number="1" location="apps/meteor/app/api/server/v1/users.ts:429">
P1: OAuth tokens are deleted using a stale pre-update user list, so active users can lose tokens under concurrent activity.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
|
||
| const { modifiedCount: count } = await Users.setActiveNotLoggedInAfterWithRole(lastLoggedIn, role, false); | ||
|
|
||
| await Promise.all([ |
There was a problem hiding this comment.
P1: OAuth tokens are deleted using a stale pre-update user list, so active users can lose tokens under concurrent activity.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/app/api/server/v1/users.ts, line 429:
<comment>OAuth tokens are deleted using a stale pre-update user list, so active users can lose tokens under concurrent activity.</comment>
<file context>
@@ -426,6 +426,12 @@ API.v1.addRoute(
const { modifiedCount: count } = await Users.setActiveNotLoggedInAfterWithRole(lastLoggedIn, role, false);
+ await Promise.all([
+ OAuthAccessTokens.deleteByUserIds(ids),
+ OAuthRefreshTokens.deleteByUserIds(ids),
</file context>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-7.10.12 #40633 +/- ##
==================================================
Coverage ? 66.28%
==================================================
Files ? 3311
Lines ? 111271
Branches ? 21058
==================================================
Hits ? 73753
Misses ? 34778
Partials ? 2740
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Backport of #40524