diff --git a/core/src/main/java/me/mastercapexd/auth/BaseAuthPlugin.java b/core/src/main/java/me/mastercapexd/auth/BaseAuthPlugin.java index 3abfe089..b08b516b 100644 --- a/core/src/main/java/me/mastercapexd/auth/BaseAuthPlugin.java +++ b/core/src/main/java/me/mastercapexd/auth/BaseAuthPlugin.java @@ -134,10 +134,9 @@ private void initializeBasic() { } this.authenticationStepContextFactoryBucket = new BaseAuthenticationStepContextFactoryBucket(config.getAuthenticationSteps()); - DatabaseHelper databaseHelper = new DatabaseHelper(this); - this.accountFactory = new AuthAccountFactory(databaseHelper); + this.accountFactory = new AuthAccountFactory(); this.linkTypeProvider = BaseLinkTypeProvider.allLinks(); - this.accountDatabase = new AuthAccountDatabaseProxy(databaseHelper); + this.accountDatabase = new AuthAccountDatabaseProxy(new DatabaseHelper(this)); this.loginManagement = new BaseLoginManagement(this); this.registerAuthenticationSteps(); diff --git a/core/src/main/java/me/mastercapexd/auth/account/factory/AuthAccountFactory.java b/core/src/main/java/me/mastercapexd/auth/account/factory/AuthAccountFactory.java index 10cdec2c..44b6f4d3 100644 --- a/core/src/main/java/me/mastercapexd/auth/account/factory/AuthAccountFactory.java +++ b/core/src/main/java/me/mastercapexd/auth/account/factory/AuthAccountFactory.java @@ -1,6 +1,5 @@ package me.mastercapexd.auth.account.factory; -import java.sql.SQLException; import java.util.ArrayList; import java.util.UUID; @@ -8,24 +7,12 @@ import com.bivashy.auth.api.type.IdentifierType; import me.mastercapexd.auth.account.AuthAccountAdapter; -import me.mastercapexd.auth.database.DatabaseHelper; import me.mastercapexd.auth.database.model.AuthAccount; public class AuthAccountFactory extends AccountFactoryTemplate { - private final DatabaseHelper databaseHelper; - - public AuthAccountFactory(DatabaseHelper databaseHelper) { - this.databaseHelper = databaseHelper; - } - @Override protected Account newAccount(String id, IdentifierType identifierType, UUID uniqueId, String name) { AuthAccount authAccount = new AuthAccount(id, identifierType, name, uniqueId); - try { - databaseHelper.getAuthAccountDao().assignEmptyForeignCollection(authAccount, "links"); - } catch(SQLException e) { - e.printStackTrace(); - } return new AuthAccountAdapter(authAccount, new ArrayList<>()); } }