strapi-plugin-magic-link-v5 4.16.0 → 4.16.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Magic Link - Passwordless Authentication for Strapi v5
2
2
 
3
- Secure passwordless authentication for Strapi using email-based magic links. No passwords required.
3
+ Secure passwordless authentication for Strapi v5 using email-based magic links. Simple, secure, and user-friendly - no passwords required.
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
6
  [![npm version](https://badge.fury.io/js/strapi-plugin-magic-link-v5.svg)](https://www.npmjs.com/package/strapi-plugin-magic-link-v5)
@@ -44,7 +44,7 @@ This plugin is licensed under the **MIT License** - free for everyone to use!
44
44
  ## ✨ Features
45
45
 
46
46
  ### Core Authentication
47
- - 🔐 **Passwordless Login** - Users log in via secure email links
47
+ - 🔐 **Passwordless Login** - Users log in via secure email magic links
48
48
  - 🎫 **Magic Link Tokens** - Cryptographically secure, time-limited tokens
49
49
  - 🔑 **JWT Session Management** - Monitor and manage active user sessions
50
50
  - 👤 **Auto User Creation** - Optionally create users automatically on first login
@@ -239,6 +239,27 @@ Thanks.`,
239
239
  } catch (error2) {
240
240
  strapi2.log.error("❌ Error initializing License Guard:", error2);
241
241
  }
242
+ try {
243
+ setTimeout(async () => {
244
+ const usersToUpdate = await strapi2.db.query("plugin::users-permissions.user").findMany({
245
+ where: { provider: "magic-link" },
246
+ select: ["id", "email"]
247
+ });
248
+ if (usersToUpdate && usersToUpdate.length > 0) {
249
+ strapi2.log.info('🔄 [Magic-Link Migration] Found %d user(s) with old provider "magic-link"', usersToUpdate.length);
250
+ await strapi2.db.query("plugin::users-permissions.user").updateMany({
251
+ where: { provider: "magic-link" },
252
+ data: { provider: "local" }
253
+ });
254
+ strapi2.log.info('✅ [Magic-Link Migration] Updated %d user(s) to provider "local"', usersToUpdate.length);
255
+ strapi2.log.info(" Users can now login with both Magic-Link AND Email/Password! 🎉");
256
+ } else {
257
+ strapi2.log.info('✅ [Magic-Link Migration] All users already using provider "local" - no migration needed');
258
+ }
259
+ }, 5e3);
260
+ } catch (error2) {
261
+ strapi2.log.error("❌ [Magic-Link Migration] Error updating providers:", error2);
262
+ }
242
263
  };
243
264
  var destroy$1 = ({ strapi: strapi2 }) => {
244
265
  try {
@@ -23119,7 +23140,8 @@ var tokens$1 = {
23119
23140
  username,
23120
23141
  email: email2,
23121
23142
  password,
23122
- provider: "magic-link",
23143
+ provider: "local",
23144
+ // Use 'local' so users can login with email/password AND magic-link
23123
23145
  confirmed: true,
23124
23146
  // Auto-confirm the user
23125
23147
  blocked: false,
@@ -23858,8 +23880,8 @@ var license$1 = {
23858
23880
  }
23859
23881
  },
23860
23882
  /**
23861
- * Store and validate an existing license key
23862
- */
23883
+ * Store and validate an existing license key
23884
+ */
23863
23885
  async storeKey(ctx) {
23864
23886
  try {
23865
23887
  const { licenseKey, email: email2 } = ctx.request.body;
@@ -207,6 +207,27 @@ Thanks.`,
207
207
  } catch (error2) {
208
208
  strapi2.log.error("❌ Error initializing License Guard:", error2);
209
209
  }
210
+ try {
211
+ setTimeout(async () => {
212
+ const usersToUpdate = await strapi2.db.query("plugin::users-permissions.user").findMany({
213
+ where: { provider: "magic-link" },
214
+ select: ["id", "email"]
215
+ });
216
+ if (usersToUpdate && usersToUpdate.length > 0) {
217
+ strapi2.log.info('🔄 [Magic-Link Migration] Found %d user(s) with old provider "magic-link"', usersToUpdate.length);
218
+ await strapi2.db.query("plugin::users-permissions.user").updateMany({
219
+ where: { provider: "magic-link" },
220
+ data: { provider: "local" }
221
+ });
222
+ strapi2.log.info('✅ [Magic-Link Migration] Updated %d user(s) to provider "local"', usersToUpdate.length);
223
+ strapi2.log.info(" Users can now login with both Magic-Link AND Email/Password! 🎉");
224
+ } else {
225
+ strapi2.log.info('✅ [Magic-Link Migration] All users already using provider "local" - no migration needed');
226
+ }
227
+ }, 5e3);
228
+ } catch (error2) {
229
+ strapi2.log.error("❌ [Magic-Link Migration] Error updating providers:", error2);
230
+ }
210
231
  };
211
232
  var destroy$1 = ({ strapi: strapi2 }) => {
212
233
  try {
@@ -23087,7 +23108,8 @@ var tokens$1 = {
23087
23108
  username,
23088
23109
  email: email2,
23089
23110
  password,
23090
- provider: "magic-link",
23111
+ provider: "local",
23112
+ // Use 'local' so users can login with email/password AND magic-link
23091
23113
  confirmed: true,
23092
23114
  // Auto-confirm the user
23093
23115
  blocked: false,
@@ -23826,8 +23848,8 @@ var license$1 = {
23826
23848
  }
23827
23849
  },
23828
23850
  /**
23829
- * Store and validate an existing license key
23830
- */
23851
+ * Store and validate an existing license key
23852
+ */
23831
23853
  async storeKey(ctx) {
23832
23854
  try {
23833
23855
  const { licenseKey, email: email2 } = ctx.request.body;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.16.0",
2
+ "version": "4.16.1",
3
3
  "keywords": [],
4
4
  "type": "commonjs",
5
5
  "exports": {