diff --git a/src/main/java/io/supertokens/storage/mysql/Start.java b/src/main/java/io/supertokens/storage/mysql/Start.java index 3436692..5a753da 100644 --- a/src/main/java/io/supertokens/storage/mysql/Start.java +++ b/src/main/java/io/supertokens/storage/mysql/Start.java @@ -49,6 +49,7 @@ import io.supertokens.pluginInterface.jwt.exceptions.DuplicateKeyIdException; import io.supertokens.pluginInterface.jwt.sqlstorage.JWTRecipeSQLStorage; import io.supertokens.pluginInterface.mfa.MfaStorage; +import io.supertokens.pluginInterface.mfa.sqlStorage.MfaSQLStorage; import io.supertokens.pluginInterface.multitenancy.*; import io.supertokens.pluginInterface.multitenancy.exceptions.DuplicateClientTypeException; import io.supertokens.pluginInterface.multitenancy.exceptions.DuplicateTenantException; @@ -106,8 +107,8 @@ public class Start implements SessionSQLStorage, EmailPasswordSQLStorage, EmailVerificationSQLStorage, ThirdPartySQLStorage, JWTRecipeSQLStorage, PasswordlessSQLStorage, UserMetadataSQLStorage, UserRolesSQLStorage, UserIdMappingStorage, - UserIdMappingSQLStorage, MultitenancyStorage, MultitenancySQLStorage, DashboardSQLStorage, TOTPSQLStorage, ActiveUsersStorage, - MfaStorage, AuthRecipeSQLStorage { + UserIdMappingSQLStorage, MultitenancyStorage, MultitenancySQLStorage, DashboardSQLStorage, TOTPSQLStorage, + ActiveUsersStorage, ActiveUsersSQLStorage, MfaStorage, MfaSQLStorage, AuthRecipeSQLStorage { // these configs are protected from being modified / viewed by the dev using the SuperTokens // SaaS. If the core is not running in SuperTokens SaaS, this array has no effect. @@ -1332,7 +1333,7 @@ public int countUsersEnabledMfaAndActiveSince(AppIdentifier appIdentifier, long } } - @Override + @Override public void deleteUserActive_Transaction(TransactionConnection con, AppIdentifier appIdentifier, String userId) throws StorageQueryException { try { @@ -2810,9 +2811,9 @@ public boolean disableFactor(TenantIdentifier tenantIdentifier, String userId, S } @Override - public boolean deleteMfaInfoForUser(AppIdentifier appIdentifier, String userId) throws StorageQueryException { + public boolean deleteMfaInfoForUser_Transaction(TransactionConnection con, AppIdentifier appIdentifier, String userId) throws StorageQueryException { try { - int deletedCount = MfaQueries.deleteUser(this, appIdentifier, userId); + int deletedCount = MfaQueries.deleteUser_Transaction(this, (Connection) con.getConnection(), appIdentifier, userId); if (deletedCount == 0) { return false; } diff --git a/src/main/java/io/supertokens/storage/mysql/queries/MfaQueries.java b/src/main/java/io/supertokens/storage/mysql/queries/MfaQueries.java index c86e9b2..128ca90 100644 --- a/src/main/java/io/supertokens/storage/mysql/queries/MfaQueries.java +++ b/src/main/java/io/supertokens/storage/mysql/queries/MfaQueries.java @@ -22,6 +22,7 @@ import io.supertokens.storage.mysql.Start; import io.supertokens.storage.mysql.config.Config; +import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; @@ -110,11 +111,11 @@ public static int disableFactor(Start start, TenantIdentifier tenantIdentifier, } - public static int deleteUser(Start start, AppIdentifier appIdentifier, String userId) + public static int deleteUser_Transaction(Start start, Connection sqlCon, AppIdentifier appIdentifier, String userId) throws StorageQueryException, SQLException { String QUERY = "DELETE FROM " + Config.getConfig(start).getMfaUserFactorsTable() + " WHERE app_id = ? AND user_id = ?"; - return update(start, QUERY, pst -> { + return update(sqlCon, QUERY, pst -> { pst.setString(1, appIdentifier.getAppId()); pst.setString(2, userId); });