strapi-security-suite 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -259,10 +259,8 @@ const bootstrap = async ({ strapi: strapi2 }) => {
259
259
  };
260
260
  async function ensureDefaultSecuritySettings(strapi2) {
261
261
  try {
262
- const existing = await strapi2.entityService.findMany(
263
- "plugin::strapi-security-suite.security_settings",
264
- {}
265
- );
262
+ const existing = await strapi2.entityService.findMany("plugin::strapi-security-suite.security-settings");
263
+ console.log(existing);
266
264
  if (Array.isArray(existing) && existing.length > 0) {
267
265
  strapi2.log.info("✅ Default security settings already exist.");
268
266
  return;
@@ -274,12 +272,10 @@ async function ensureDefaultSecuritySettings(strapi2) {
274
272
  nonReusablePassword: true,
275
273
  enablePasswordManagement: true
276
274
  };
277
- await strapi2.entityService.create(
278
- "plugin::strapi-security-suite.security_settings",
279
- { data: DEFAULT_SETTINGS }
280
- );
275
+ await strapi2.db.query("plugin::strapi-security-suite.security-settings").create({ data: DEFAULT_SETTINGS });
281
276
  strapi2.log.info("✅ Default security settings created successfully.");
282
277
  } catch (error) {
278
+ console.log(error);
283
279
  strapi2.log.error("❌ Failed to ensure default security settings:", error);
284
280
  }
285
281
  }
@@ -256,10 +256,8 @@ const bootstrap = async ({ strapi: strapi2 }) => {
256
256
  };
257
257
  async function ensureDefaultSecuritySettings(strapi2) {
258
258
  try {
259
- const existing = await strapi2.entityService.findMany(
260
- "plugin::strapi-security-suite.security_settings",
261
- {}
262
- );
259
+ const existing = await strapi2.entityService.findMany("plugin::strapi-security-suite.security-settings");
260
+ console.log(existing);
263
261
  if (Array.isArray(existing) && existing.length > 0) {
264
262
  strapi2.log.info("✅ Default security settings already exist.");
265
263
  return;
@@ -271,12 +269,10 @@ async function ensureDefaultSecuritySettings(strapi2) {
271
269
  nonReusablePassword: true,
272
270
  enablePasswordManagement: true
273
271
  };
274
- await strapi2.entityService.create(
275
- "plugin::strapi-security-suite.security_settings",
276
- { data: DEFAULT_SETTINGS }
277
- );
272
+ await strapi2.db.query("plugin::strapi-security-suite.security-settings").create({ data: DEFAULT_SETTINGS });
278
273
  strapi2.log.info("✅ Default security settings created successfully.");
279
274
  } catch (error) {
275
+ console.log(error);
280
276
  strapi2.log.error("❌ Failed to ensure default security settings:", error);
281
277
  }
282
278
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.2.0",
2
+ "version": "0.2.1",
3
3
  "keywords": [
4
4
  "strapi",
5
5
  "plugin",