diff --git a/build.gradle b/build.gradle index c4779d56c..17e593dbc 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ compileTestJava { options.encoding = "UTF-8" } // } //} -version = "9.3.0" +version = "9.4.0" repositories { mavenCentral() diff --git a/src/main/java/io/supertokens/authRecipe/AuthRecipe.java b/src/main/java/io/supertokens/authRecipe/AuthRecipe.java index d8eb407ed..1b0da61a8 100644 --- a/src/main/java/io/supertokens/authRecipe/AuthRecipe.java +++ b/src/main/java/io/supertokens/authRecipe/AuthRecipe.java @@ -418,7 +418,8 @@ private static void checkIfLoginMethodCanBeLinkedOnTenant(TransactionConnection if (!userWithSameThirdParty.tenantIds.contains(tenantId)) { continue; } - if (userWithSameThirdParty.isPrimaryUser) { + if (userWithSameThirdParty.isPrimaryUser && + !userWithSameThirdParty.getSupertokensUserId().equals(primaryUser.getSupertokensUserId())) { throw new AccountInfoAlreadyAssociatedWithAnotherPrimaryUserIdException( userWithSameThirdParty.getSupertokensUserId(), "This user's third party login is already associated with another" +