strapi-plugin-firebase-authentication 1.1.11 → 1.2.0

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.
Files changed (33) hide show
  1. package/dist/_chunks/{App-DZQe17x8.js → App-B7d4qS3T.js} +203 -141
  2. package/dist/_chunks/{App-BY1gNGKH.mjs → App-CQ9ehArz.mjs} +112 -29
  3. package/dist/_chunks/{api-D_4cdJU5.mjs → api-BM2UtpvM.mjs} +1 -1
  4. package/dist/_chunks/{api-DR4wmAFN.js → api-DYP-1kdx.js} +1 -1
  5. package/dist/_chunks/{index-D8pv1Q6h.mjs → index-0tTyhxbb.mjs} +148 -34
  6. package/dist/_chunks/{index-BnT1fFPr.js → index-B5EwGI_y.js} +2 -2
  7. package/dist/_chunks/{index-DtGfwf9S.mjs → index-CMFutRyI.mjs} +2 -2
  8. package/dist/_chunks/{index-dVTLVmwU.js → index-Cwp9xkG4.js} +148 -34
  9. package/dist/admin/index.js +1 -1
  10. package/dist/admin/index.mjs +1 -1
  11. package/dist/admin/src/components/user-management/ResendVerification/ResendVerification.d.ts +9 -0
  12. package/dist/admin/src/components/user-management/index.d.ts +1 -0
  13. package/dist/admin/src/pages/Settings/api.d.ts +4 -0
  14. package/dist/admin/src/pages/utils/api.d.ts +2 -1
  15. package/dist/server/index.js +6447 -2301
  16. package/dist/server/index.mjs +6444 -2298
  17. package/dist/server/src/config/index.d.ts +1 -1
  18. package/dist/server/src/content-types/index.d.ts +23 -0
  19. package/dist/server/src/controllers/firebaseController.d.ts +24 -0
  20. package/dist/server/src/controllers/index.d.ts +4 -0
  21. package/dist/server/src/controllers/userController.d.ts +1 -0
  22. package/dist/server/src/index.d.ts +65 -2
  23. package/dist/server/src/services/emailService.d.ts +19 -0
  24. package/dist/server/src/services/firebaseService.d.ts +19 -2
  25. package/dist/server/src/services/index.d.ts +37 -1
  26. package/dist/server/src/services/settingsService.d.ts +2 -0
  27. package/dist/server/src/services/tokenService.d.ts +49 -0
  28. package/dist/server/src/services/userService.d.ts +27 -1
  29. package/dist/server/src/templates/defaults/email-verification.d.ts +2 -0
  30. package/dist/server/src/templates/defaults/index.d.ts +2 -0
  31. package/dist/server/src/templates/defaults/password-changed.d.ts +2 -0
  32. package/dist/server/src/templates/types.d.ts +6 -2
  33. package/package.json +1 -1
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const React = require("react");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const admin = require("@strapi/strapi/admin");
7
- const api = require("./api-DR4wmAFN.js");
7
+ const api = require("./api-DYP-1kdx.js");
8
8
  const reactRouterDom = require("react-router-dom");
9
9
  function SettingsPage() {
10
10
  const { toggleNotification } = admin.useNotification();
@@ -22,6 +22,10 @@ function SettingsPage() {
22
22
  const [magicLinkUrl, setMagicLinkUrl] = React.useState("http://localhost:1338/verify-magic-link.html");
23
23
  const [magicLinkEmailSubject, setMagicLinkEmailSubject] = React.useState("Sign in to Your Application");
24
24
  const [magicLinkExpiryHours, setMagicLinkExpiryHours] = React.useState(1);
25
+ const [emailVerificationUrl, setEmailVerificationUrl] = React.useState(
26
+ "http://localhost:3000/verify-email"
27
+ );
28
+ const [emailVerificationEmailSubject, setEmailVerificationEmailSubject] = React.useState("Verify Your Email");
25
29
  const [loading, setLoading] = React.useState(true);
26
30
  const [showEditModal, setShowEditModal] = React.useState(false);
27
31
  const [editWebApiKey, setEditWebApiKey] = React.useState("");
@@ -48,6 +52,8 @@ function SettingsPage() {
48
52
  setMagicLinkUrl(data?.magicLinkUrl || "http://localhost:1338/verify-magic-link.html");
49
53
  setMagicLinkEmailSubject(data?.magicLinkEmailSubject || "Sign in to Your Application");
50
54
  setMagicLinkExpiryHours(data?.magicLinkExpiryHours || 1);
55
+ setEmailVerificationUrl(data?.emailVerificationUrl || "http://localhost:3000/verify-email");
56
+ setEmailVerificationEmailSubject(data?.emailVerificationEmailSubject || "Verify Your Email");
51
57
  }).catch((error) => {
52
58
  setLoading(false);
53
59
  console.error("Error retrieving Firebase config:", error);
@@ -73,6 +79,8 @@ function SettingsPage() {
73
79
  setMagicLinkUrl("http://localhost:1338/verify-magic-link.html");
74
80
  setMagicLinkEmailSubject("Sign in to Your Application");
75
81
  setMagicLinkExpiryHours(1);
82
+ setEmailVerificationUrl("http://localhost:3000/verify-email");
83
+ setEmailVerificationEmailSubject("Verify Your Email");
76
84
  setLoading(false);
77
85
  toggleNotification({
78
86
  type: "success",
@@ -98,7 +106,9 @@ function SettingsPage() {
98
106
  enableMagicLink,
99
107
  magicLinkUrl,
100
108
  magicLinkEmailSubject,
101
- magicLinkExpiryHours
109
+ magicLinkExpiryHours,
110
+ emailVerificationUrl,
111
+ emailVerificationEmailSubject
102
112
  });
103
113
  if (!data || !data.firebase_config_json) {
104
114
  throw new Error("Invalid response from server");
@@ -129,7 +139,9 @@ function SettingsPage() {
129
139
  enableMagicLink,
130
140
  magicLinkUrl,
131
141
  magicLinkEmailSubject,
132
- magicLinkExpiryHours
142
+ magicLinkExpiryHours,
143
+ emailVerificationUrl,
144
+ emailVerificationEmailSubject
133
145
  });
134
146
  if (data) {
135
147
  setPasswordRequirementsRegex(data.passwordRequirementsRegex || passwordRequirementsRegex);
@@ -140,6 +152,8 @@ function SettingsPage() {
140
152
  setMagicLinkUrl(data.magicLinkUrl || magicLinkUrl);
141
153
  setMagicLinkEmailSubject(data.magicLinkEmailSubject || magicLinkEmailSubject);
142
154
  setMagicLinkExpiryHours(data.magicLinkExpiryHours || magicLinkExpiryHours);
155
+ setEmailVerificationUrl(data.emailVerificationUrl || emailVerificationUrl);
156
+ setEmailVerificationEmailSubject(data.emailVerificationEmailSubject || emailVerificationEmailSubject);
143
157
  }
144
158
  setLoading(false);
145
159
  toggleNotification({
@@ -166,13 +180,17 @@ function SettingsPage() {
166
180
  enableMagicLink,
167
181
  magicLinkUrl,
168
182
  magicLinkEmailSubject,
169
- magicLinkExpiryHours
183
+ magicLinkExpiryHours,
184
+ emailVerificationUrl,
185
+ emailVerificationEmailSubject
170
186
  });
171
187
  if (data) {
172
188
  setEnableMagicLink(data.enableMagicLink || enableMagicLink);
173
189
  setMagicLinkUrl(data.magicLinkUrl || magicLinkUrl);
174
190
  setMagicLinkEmailSubject(data.magicLinkEmailSubject || magicLinkEmailSubject);
175
191
  setMagicLinkExpiryHours(data.magicLinkExpiryHours || magicLinkExpiryHours);
192
+ setEmailVerificationUrl(data.emailVerificationUrl || emailVerificationUrl);
193
+ setEmailVerificationEmailSubject(data.emailVerificationEmailSubject || emailVerificationEmailSubject);
176
194
  }
177
195
  setLoading(false);
178
196
  toggleNotification({
@@ -188,6 +206,39 @@ function SettingsPage() {
188
206
  setLoading(false);
189
207
  }
190
208
  };
209
+ const handleSaveEmailVerificationSettings = async () => {
210
+ try {
211
+ setLoading(true);
212
+ const data = await api.savePasswordSettings({
213
+ passwordRequirementsRegex,
214
+ passwordRequirementsMessage,
215
+ passwordResetUrl,
216
+ passwordResetEmailSubject,
217
+ enableMagicLink,
218
+ magicLinkUrl,
219
+ magicLinkEmailSubject,
220
+ magicLinkExpiryHours,
221
+ emailVerificationUrl,
222
+ emailVerificationEmailSubject
223
+ });
224
+ if (data) {
225
+ setEmailVerificationUrl(data.emailVerificationUrl || emailVerificationUrl);
226
+ setEmailVerificationEmailSubject(data.emailVerificationEmailSubject || emailVerificationEmailSubject);
227
+ }
228
+ setLoading(false);
229
+ toggleNotification({
230
+ type: "success",
231
+ message: "Email verification settings saved successfully"
232
+ });
233
+ } catch (error) {
234
+ console.error("Error saving email verification settings:", error);
235
+ toggleNotification({
236
+ type: "warning",
237
+ message: "Failed to save email verification settings"
238
+ });
239
+ setLoading(false);
240
+ }
241
+ };
191
242
  const handleAddWebApiKey = () => {
192
243
  setEditWebApiKey("");
193
244
  setShowEditModal(true);
@@ -208,7 +259,9 @@ function SettingsPage() {
208
259
  enableMagicLink,
209
260
  magicLinkUrl,
210
261
  magicLinkEmailSubject,
211
- magicLinkExpiryHours
262
+ magicLinkExpiryHours,
263
+ emailVerificationUrl,
264
+ emailVerificationEmailSubject
212
265
  });
213
266
  if (!data || !data.firebase_config_json) {
214
267
  throw new Error("Invalid response from server");
@@ -241,7 +294,9 @@ function SettingsPage() {
241
294
  enableMagicLink,
242
295
  magicLinkUrl,
243
296
  magicLinkEmailSubject,
244
- magicLinkExpiryHours
297
+ magicLinkExpiryHours,
298
+ emailVerificationUrl,
299
+ emailVerificationEmailSubject
245
300
  });
246
301
  if (!data || !data.firebase_config_json) {
247
302
  throw new Error("Invalid response from server");
@@ -563,34 +618,7 @@ function SettingsPage() {
563
618
  }
564
619
  )
565
620
  ] }),
566
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 3, children: [
567
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Password Reset URL *" }),
568
- /* @__PURE__ */ jsxRuntime.jsx(
569
- designSystem.TextInput,
570
- {
571
- name: "passwordResetUrl",
572
- value: passwordResetUrl,
573
- onChange: (e) => setPasswordResetUrl(e.target.value),
574
- placeholder: "https://yourapp.com/reset-password",
575
- hint: "URL where users will reset their password (your frontend application)",
576
- required: true
577
- }
578
- )
579
- ] }),
580
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 3, children: [
581
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Reset Email Subject" }),
582
- /* @__PURE__ */ jsxRuntime.jsx(
583
- designSystem.TextInput,
584
- {
585
- name: "passwordResetEmailSubject",
586
- value: passwordResetEmailSubject,
587
- onChange: (e) => setPasswordResetEmailSubject(e.target.value),
588
- placeholder: "Reset Your Password",
589
- hint: "Subject line for password reset emails"
590
- }
591
- )
592
- ] }),
593
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginTop: 4, padding: 3, background: "neutral100", borderRadius: "4px", children: [
621
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 4, padding: 3, background: "neutral100", borderRadius: "4px", children: [
594
622
  /* @__PURE__ */ jsxRuntime.jsx(
595
623
  designSystem.Typography,
596
624
  {
@@ -623,6 +651,33 @@ function SettingsPage() {
623
651
  ] })
624
652
  ] })
625
653
  ] }),
654
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 3, children: [
655
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Password Reset URL *" }),
656
+ /* @__PURE__ */ jsxRuntime.jsx(
657
+ designSystem.TextInput,
658
+ {
659
+ name: "passwordResetUrl",
660
+ value: passwordResetUrl,
661
+ onChange: (e) => setPasswordResetUrl(e.target.value),
662
+ placeholder: "https://yourapp.com/reset-password",
663
+ hint: "URL where users will reset their password (your frontend application)",
664
+ required: true
665
+ }
666
+ )
667
+ ] }),
668
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 3, children: [
669
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Reset Email Subject" }),
670
+ /* @__PURE__ */ jsxRuntime.jsx(
671
+ designSystem.TextInput,
672
+ {
673
+ name: "passwordResetEmailSubject",
674
+ value: passwordResetEmailSubject,
675
+ onChange: (e) => setPasswordResetEmailSubject(e.target.value),
676
+ placeholder: "Reset Your Password",
677
+ hint: "Subject line for password reset emails"
678
+ }
679
+ )
680
+ ] }),
626
681
  /* @__PURE__ */ jsxRuntime.jsx(
627
682
  designSystem.Flex,
628
683
  {
@@ -635,6 +690,65 @@ function SettingsPage() {
635
690
  }
636
691
  )
637
692
  ] }),
693
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "neutral0", borderRadius: "4px", shadow: "filterShadow", marginBottom: 6, children: [
694
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", as: "h2", style: { display: "block", marginBottom: "8px" }, children: "Email Verification" }),
695
+ /* @__PURE__ */ jsxRuntime.jsx(
696
+ designSystem.Typography,
697
+ {
698
+ variant: "omega",
699
+ textColor: "neutral600",
700
+ style: { display: "block", marginBottom: "24px" },
701
+ children: "Configure email verification settings for new user registration"
702
+ }
703
+ ),
704
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 3, children: [
705
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Email Verification URL *" }),
706
+ /* @__PURE__ */ jsxRuntime.jsx(
707
+ designSystem.TextInput,
708
+ {
709
+ name: "emailVerificationUrl",
710
+ value: emailVerificationUrl,
711
+ onChange: (e) => setEmailVerificationUrl(e.target.value),
712
+ placeholder: "https://yourapp.com/verify-email",
713
+ hint: "URL where users will verify their email address (your frontend application)",
714
+ required: true
715
+ }
716
+ )
717
+ ] }),
718
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { marginBottom: 3, children: [
719
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Verification Email Subject" }),
720
+ /* @__PURE__ */ jsxRuntime.jsx(
721
+ designSystem.TextInput,
722
+ {
723
+ name: "emailVerificationEmailSubject",
724
+ value: emailVerificationEmailSubject,
725
+ onChange: (e) => setEmailVerificationEmailSubject(e.target.value),
726
+ placeholder: "Verify Your Email",
727
+ hint: "Subject line for email verification emails"
728
+ }
729
+ )
730
+ ] }),
731
+ /* @__PURE__ */ jsxRuntime.jsx(
732
+ designSystem.Flex,
733
+ {
734
+ style: {
735
+ marginTop: 24,
736
+ width: "100%"
737
+ },
738
+ justifyContent: "flex-end",
739
+ children: /* @__PURE__ */ jsxRuntime.jsx(
740
+ designSystem.Button,
741
+ {
742
+ size: "L",
743
+ variant: "secondary",
744
+ onClick: handleSaveEmailVerificationSettings,
745
+ disabled: loading,
746
+ children: "Save Email Verification Settings"
747
+ }
748
+ )
749
+ }
750
+ )
751
+ ] }),
638
752
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { padding: 4, background: "neutral0", borderRadius: "4px", shadow: "filterShadow", marginBottom: 6, children: [
639
753
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", as: "h2", style: { display: "block", marginBottom: "8px" }, children: "Magic Link Authentication" }),
640
754
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const index = require("../_chunks/index-BnT1fFPr.js");
2
+ const index = require("../_chunks/index-B5EwGI_y.js");
3
3
  require("react/jsx-runtime");
4
4
  require("@strapi/strapi/admin");
5
5
  require("@strapi/design-system");
@@ -1,4 +1,4 @@
1
- import { p } from "../_chunks/index-DtGfwf9S.mjs";
1
+ import { p } from "../_chunks/index-CMFutRyI.mjs";
2
2
  import "react/jsx-runtime";
3
3
  import "@strapi/strapi/admin";
4
4
  import "@strapi/design-system";
@@ -0,0 +1,9 @@
1
+ interface ResendVerificationProps {
2
+ isOpen: boolean;
3
+ email: string;
4
+ userId: string;
5
+ onClose: () => void;
6
+ onSendVerificationEmail: () => Promise<void>;
7
+ }
8
+ export declare const ResendVerification: ({ isOpen, email, userId, onClose, onSendVerificationEmail, }: ResendVerificationProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -1,2 +1,3 @@
1
1
  export { DeleteAccount } from "./DeleteAccount/DeleteAccount";
2
2
  export { ResetPassword } from "./ResetPassword/ResetPassword";
3
+ export { ResendVerification } from "./ResendVerification/ResendVerification";
@@ -8,6 +8,8 @@ export declare const saveFirebaseConfig: (json: string, firebaseWebApiKey?: stri
8
8
  magicLinkUrl?: string;
9
9
  magicLinkEmailSubject?: string;
10
10
  magicLinkExpiryHours?: number;
11
+ emailVerificationUrl?: string;
12
+ emailVerificationEmailSubject?: string;
11
13
  }) => Promise<any>;
12
14
  export declare const getFirebaseConfig: () => Promise<any>;
13
15
  export declare const delFirebaseConfig: () => Promise<any>;
@@ -20,4 +22,6 @@ export declare const savePasswordSettings: (passwordConfig: {
20
22
  magicLinkUrl?: string;
21
23
  magicLinkEmailSubject?: string;
22
24
  magicLinkExpiryHours?: number;
25
+ emailVerificationUrl?: string;
26
+ emailVerificationEmailSubject?: string;
23
27
  }) => Promise<any>;
@@ -34,4 +34,5 @@ declare const resetUserPassword: (idToUpdate: string, payload: {
34
34
  declare const sendResetEmail: (userId: string) => Promise<any>;
35
35
  declare const getFirebaseConfig: () => Promise<any>;
36
36
  declare const sendPasswordResetEmail: (userId: string) => Promise<any>;
37
- export { fetchUsers, fetchUserByID, deleteUser, updateUser, createUser, fetchStrapiUsers, fetchStrapiUserById, resetUserPassword, sendResetEmail, getFirebaseConfig, sendPasswordResetEmail, };
37
+ declare const sendVerificationEmail: (userId: string) => Promise<any>;
38
+ export { fetchUsers, fetchUserByID, deleteUser, updateUser, createUser, fetchStrapiUsers, fetchStrapiUserById, resetUserPassword, sendResetEmail, getFirebaseConfig, sendPasswordResetEmail, sendVerificationEmail, };