Skip to content

Commit

Permalink
fix: removed removal of active user
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed Aug 29, 2023
1 parent 5a01102 commit d62c2fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws I
AuthRecipe.LinkAccountsResult linkAccountsResult = AuthRecipe.linkAccounts(main,
primaryUserIdAppIdentifierWithStorage,
recipeUserId, primaryUserId);
// Remove linked account user id from active user
ActiveUsers.removeActiveUser(recipeUserIdAppIdentifierWithStorage, recipeUserId);

UserIdMapping.populateExternalUserIdForUsers(primaryUserIdAppIdentifierWithStorage, new AuthRecipeUserInfo[]{linkAccountsResult.user});
JsonObject response = new JsonObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ public void testActiveUserIsRemovedAfterLinkingAccounts() throws Exception {
WebserverAPI.getLatestCDIVersion().get(), "");
}

// Now there should be only one active user
// we don't remove the active user for the recipe user, so it should still be 2
userCount = ActiveUsers.countUsersActiveSince(process.getProcess(), System.currentTimeMillis() - 10000);
assertEquals(1, userCount);
assertEquals(2, userCount);

// Sign in to the accounts once again
{
Expand Down Expand Up @@ -188,7 +188,7 @@ public void testActiveUserIsRemovedAfterLinkingAccounts() throws Exception {

// there should still be only one active user
userCount = ActiveUsers.countUsersActiveSince(process.getProcess(), System.currentTimeMillis() - 10000);
assertEquals(1, userCount);
assertEquals(2, userCount);

process.kill();
assertNotNull(process.checkOrWaitForEvent(ProcessState.PROCESS_STATE.STOPPED));
Expand Down

0 comments on commit d62c2fc

Please sign in to comment.