diff --git a/src/main/java/io/supertokens/webserver/api/accountlinking/LinkAccountsAPI.java b/src/main/java/io/supertokens/webserver/api/accountlinking/LinkAccountsAPI.java index 10f7a7bd1..76a9d4dfe 100644 --- a/src/main/java/io/supertokens/webserver/api/accountlinking/LinkAccountsAPI.java +++ b/src/main/java/io/supertokens/webserver/api/accountlinking/LinkAccountsAPI.java @@ -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(); diff --git a/src/test/java/io/supertokens/test/accountlinking/api/ActiveUserTest.java b/src/test/java/io/supertokens/test/accountlinking/api/ActiveUserTest.java index 3c0a90fd0..10c652c3c 100644 --- a/src/test/java/io/supertokens/test/accountlinking/api/ActiveUserTest.java +++ b/src/test/java/io/supertokens/test/accountlinking/api/ActiveUserTest.java @@ -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 { @@ -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));