strapi-plugin-firebase-authentication 1.2.3 → 1.2.5
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/dist/_chunks/{App-D0dXofYU.js → App-BmP-duLn.js} +2 -2
- package/dist/_chunks/{App-BwSwStYD.mjs → App-DjamRMm8.mjs} +2 -2
- package/dist/_chunks/{api-BPWH3Tkt.js → api-Bg075IIT.js} +1 -1
- package/dist/_chunks/{api-ApHylTX3.mjs → api-CLQa5PFi.mjs} +1 -1
- package/dist/_chunks/{index-BiKfIixL.mjs → index-B2NvsXdF.mjs} +2 -2
- package/dist/_chunks/{index-CwdQ9EjS.js → index-B4ptk_Em.js} +62 -7
- package/dist/_chunks/{index-CoM6JZZ8.mjs → index-CAZnRswo.mjs} +62 -7
- package/dist/_chunks/{index-CEHB1Gia.js → index-CyOVjVQb.js} +2 -2
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/pages/Settings/api.d.ts +4 -0
- package/dist/server/index.js +57 -10
- package/dist/server/index.mjs +57 -10
- package/dist/server/src/content-types/index.d.ts +10 -0
- package/dist/server/src/index.d.ts +12 -0
- package/dist/server/src/services/index.d.ts +2 -0
- package/dist/server/src/services/settingsService.d.ts +2 -0
- package/package.json +1 -1
|
@@ -5,9 +5,9 @@ const admin = require("@strapi/strapi/admin");
|
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
6
|
const rt = require("@radix-ui/react-tooltip");
|
|
7
7
|
const m = require("react");
|
|
8
|
-
const api = require("./api-
|
|
8
|
+
const api = require("./api-Bg075IIT.js");
|
|
9
9
|
const reactIntl = require("react-intl");
|
|
10
|
-
const index = require("./index-
|
|
10
|
+
const index = require("./index-CyOVjVQb.js");
|
|
11
11
|
const styled = require("styled-components");
|
|
12
12
|
const rx = require("react-icons/rx");
|
|
13
13
|
const ai = require("react-icons/ai");
|
|
@@ -3,9 +3,9 @@ import { Layouts, useQueryParams as useQueryParams$1, getFetchClient, Pagination
|
|
|
3
3
|
import { useNavigate, useLocation, useParams, Routes, Route } from "react-router-dom";
|
|
4
4
|
import { Provider } from "@radix-ui/react-tooltip";
|
|
5
5
|
import m__default, { useState, useCallback, useMemo, useEffect, useRef, useLayoutEffect } from "react";
|
|
6
|
-
import { z as zc, T, R, N as Nn, A as Ar, S as S1, k as k1, a as A1, b as Tr, E, t as t1, v as v1, C as C1, $ as $1, c as bo, w as wo, h as h0, d as a0, o as ot, K as Km, x as x1, G as G0, e as vm, g as getFirebaseConfig$1, F as Fm, D as D1, p as pl } from "./api-
|
|
6
|
+
import { z as zc, T, R, N as Nn, A as Ar, S as S1, k as k1, a as A1, b as Tr, E, t as t1, v as v1, C as C1, $ as $1, c as bo, w as wo, h as h0, d as a0, o as ot, K as Km, x as x1, G as G0, e as vm, g as getFirebaseConfig$1, F as Fm, D as D1, p as pl } from "./api-CLQa5PFi.mjs";
|
|
7
7
|
import { useIntl } from "react-intl";
|
|
8
|
-
import { i as isArguments_1, a as isBufferExports, b as isTypedArray_1, c as isLength_1, d as isFunction_1, _ as _getTag, e as _Stack, f as _equalArrays, g as _equalByTag, h as isObjectLike_1, j as getDefaultExportFromCjs, U as U2, k as _baseGetTag, l as _MapCache, m as _Symbol, n as m3, o as bn, N as Nn$1, Y as Y2, J as J2, P as PLUGIN_ID, p as getAugmentedNamespace, q as commonjsGlobal, u as un, s as sn, r as _3 } from "./index-
|
|
8
|
+
import { i as isArguments_1, a as isBufferExports, b as isTypedArray_1, c as isLength_1, d as isFunction_1, _ as _getTag, e as _Stack, f as _equalArrays, g as _equalByTag, h as isObjectLike_1, j as getDefaultExportFromCjs, U as U2, k as _baseGetTag, l as _MapCache, m as _Symbol, n as m3, o as bn, N as Nn$1, Y as Y2, J as J2, P as PLUGIN_ID, p as getAugmentedNamespace, q as commonjsGlobal, u as un, s as sn, r as _3 } from "./index-B2NvsXdF.mjs";
|
|
9
9
|
import styled from "styled-components";
|
|
10
10
|
import { RxCheck, RxCross2 } from "react-icons/rx";
|
|
11
11
|
import { AiOutlineUserAdd, AiFillPhone, AiFillMail, AiFillYahoo, AiFillGithub, AiFillTwitterCircle, AiFillFacebook, AiFillApple, AiFillGoogleCircle } from "react-icons/ai";
|
|
@@ -4,7 +4,7 @@ const m = require("react");
|
|
|
4
4
|
const jsxRuntime = require("react/jsx-runtime");
|
|
5
5
|
const rt = require("@radix-ui/react-tooltip");
|
|
6
6
|
const we$1 = require("react-dom");
|
|
7
|
-
const index$2 = require("./index-
|
|
7
|
+
const index$2 = require("./index-CyOVjVQb.js");
|
|
8
8
|
const admin = require("@strapi/strapi/admin");
|
|
9
9
|
function _interopNamespace(e) {
|
|
10
10
|
if (e && e.__esModule) return e;
|
|
@@ -5,7 +5,7 @@ import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
|
5
5
|
import * as rt from "@radix-ui/react-tooltip";
|
|
6
6
|
import * as we$1 from "react-dom";
|
|
7
7
|
import we__default, { flushSync, createPortal } from "react-dom";
|
|
8
|
-
import { q as commonjsGlobal, J as J2, R as R3, C as C5, t as f5, v as a5, N as Nn$1, w as r3, x as f3, u as un$1, y as w5, z as h5, K as K2, A as o5, P as PLUGIN_ID } from "./index-
|
|
8
|
+
import { q as commonjsGlobal, J as J2, R as R3, C as C5, t as f5, v as a5, N as Nn$1, w as r3, x as f3, u as un$1, y as w5, z as h5, K as K2, A as o5, P as PLUGIN_ID } from "./index-B2NvsXdF.mjs";
|
|
9
9
|
import { getFetchClient } from "@strapi/strapi/admin";
|
|
10
10
|
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
11
11
|
const callbackRef = useRef(callback);
|
|
@@ -2662,7 +2662,7 @@ const index = {
|
|
|
2662
2662
|
id: `${PLUGIN_ID}.page.title`,
|
|
2663
2663
|
defaultMessage: PLUGIN_ID
|
|
2664
2664
|
},
|
|
2665
|
-
Component: () => import("./App-
|
|
2665
|
+
Component: () => import("./App-DjamRMm8.mjs").then((mod) => ({
|
|
2666
2666
|
default: mod.App
|
|
2667
2667
|
})),
|
|
2668
2668
|
permissions: PERMISSIONS["menu-link"]
|
|
@@ -2684,7 +2684,7 @@ const index = {
|
|
|
2684
2684
|
id: "settings",
|
|
2685
2685
|
to: `/settings/${PLUGIN_ID}`,
|
|
2686
2686
|
async Component() {
|
|
2687
|
-
const component = await import("./index-
|
|
2687
|
+
const component = await import("./index-CAZnRswo.mjs");
|
|
2688
2688
|
return component.default;
|
|
2689
2689
|
},
|
|
2690
2690
|
permissions: PERMISSIONS["menu-link"]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const m = require("react");
|
|
5
|
-
const api = require("./api-
|
|
5
|
+
const api = require("./api-Bg075IIT.js");
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
7
|
const reactRouterDom = require("react-router-dom");
|
|
8
8
|
function SettingsPage() {
|
|
@@ -25,6 +25,8 @@ function SettingsPage() {
|
|
|
25
25
|
"http://localhost:3000/verify-email"
|
|
26
26
|
);
|
|
27
27
|
const [emailVerificationEmailSubject, setEmailVerificationEmailSubject] = m.useState("Verify Your Email");
|
|
28
|
+
const [includeCredentialsInPasswordResetLink, setIncludeCredentialsInPasswordResetLink] = m.useState(false);
|
|
29
|
+
const [includeCredentialsInVerificationLink, setIncludeCredentialsInVerificationLink] = m.useState(false);
|
|
28
30
|
const [loading, setLoading] = m.useState(true);
|
|
29
31
|
const [showEditModal, setShowEditModal] = m.useState(false);
|
|
30
32
|
const [editWebApiKey, setEditWebApiKey] = m.useState("");
|
|
@@ -53,6 +55,8 @@ function SettingsPage() {
|
|
|
53
55
|
setMagicLinkExpiryHours(data?.magicLinkExpiryHours || 1);
|
|
54
56
|
setEmailVerificationUrl(data?.emailVerificationUrl || "http://localhost:3000/verify-email");
|
|
55
57
|
setEmailVerificationEmailSubject(data?.emailVerificationEmailSubject || "Verify Your Email");
|
|
58
|
+
setIncludeCredentialsInPasswordResetLink(data?.includeCredentialsInPasswordResetLink || false);
|
|
59
|
+
setIncludeCredentialsInVerificationLink(data?.includeCredentialsInVerificationLink || false);
|
|
56
60
|
}).catch((error) => {
|
|
57
61
|
setLoading(false);
|
|
58
62
|
console.error("Error retrieving Firebase config:", error);
|
|
@@ -80,6 +84,8 @@ function SettingsPage() {
|
|
|
80
84
|
setMagicLinkExpiryHours(1);
|
|
81
85
|
setEmailVerificationUrl("http://localhost:3000/verify-email");
|
|
82
86
|
setEmailVerificationEmailSubject("Verify Your Email");
|
|
87
|
+
setIncludeCredentialsInPasswordResetLink(false);
|
|
88
|
+
setIncludeCredentialsInVerificationLink(false);
|
|
83
89
|
setLoading(false);
|
|
84
90
|
toggleNotification({
|
|
85
91
|
type: "success",
|
|
@@ -107,7 +113,9 @@ function SettingsPage() {
|
|
|
107
113
|
magicLinkEmailSubject,
|
|
108
114
|
magicLinkExpiryHours,
|
|
109
115
|
emailVerificationUrl,
|
|
110
|
-
emailVerificationEmailSubject
|
|
116
|
+
emailVerificationEmailSubject,
|
|
117
|
+
includeCredentialsInPasswordResetLink,
|
|
118
|
+
includeCredentialsInVerificationLink
|
|
111
119
|
});
|
|
112
120
|
if (!data || !data.firebase_config_json) {
|
|
113
121
|
throw new Error("Invalid response from server");
|
|
@@ -140,7 +148,9 @@ function SettingsPage() {
|
|
|
140
148
|
magicLinkEmailSubject,
|
|
141
149
|
magicLinkExpiryHours,
|
|
142
150
|
emailVerificationUrl,
|
|
143
|
-
emailVerificationEmailSubject
|
|
151
|
+
emailVerificationEmailSubject,
|
|
152
|
+
includeCredentialsInPasswordResetLink,
|
|
153
|
+
includeCredentialsInVerificationLink
|
|
144
154
|
});
|
|
145
155
|
if (data) {
|
|
146
156
|
setPasswordRequirementsRegex(data.passwordRequirementsRegex || passwordRequirementsRegex);
|
|
@@ -153,6 +163,12 @@ function SettingsPage() {
|
|
|
153
163
|
setMagicLinkExpiryHours(data.magicLinkExpiryHours || magicLinkExpiryHours);
|
|
154
164
|
setEmailVerificationUrl(data.emailVerificationUrl || emailVerificationUrl);
|
|
155
165
|
setEmailVerificationEmailSubject(data.emailVerificationEmailSubject || emailVerificationEmailSubject);
|
|
166
|
+
setIncludeCredentialsInPasswordResetLink(
|
|
167
|
+
data.includeCredentialsInPasswordResetLink ?? includeCredentialsInPasswordResetLink
|
|
168
|
+
);
|
|
169
|
+
setIncludeCredentialsInVerificationLink(
|
|
170
|
+
data.includeCredentialsInVerificationLink ?? includeCredentialsInVerificationLink
|
|
171
|
+
);
|
|
156
172
|
}
|
|
157
173
|
setLoading(false);
|
|
158
174
|
toggleNotification({
|
|
@@ -181,7 +197,9 @@ function SettingsPage() {
|
|
|
181
197
|
magicLinkEmailSubject,
|
|
182
198
|
magicLinkExpiryHours,
|
|
183
199
|
emailVerificationUrl,
|
|
184
|
-
emailVerificationEmailSubject
|
|
200
|
+
emailVerificationEmailSubject,
|
|
201
|
+
includeCredentialsInPasswordResetLink,
|
|
202
|
+
includeCredentialsInVerificationLink
|
|
185
203
|
});
|
|
186
204
|
if (data) {
|
|
187
205
|
setEnableMagicLink(data.enableMagicLink || enableMagicLink);
|
|
@@ -218,11 +236,16 @@ function SettingsPage() {
|
|
|
218
236
|
magicLinkEmailSubject,
|
|
219
237
|
magicLinkExpiryHours,
|
|
220
238
|
emailVerificationUrl,
|
|
221
|
-
emailVerificationEmailSubject
|
|
239
|
+
emailVerificationEmailSubject,
|
|
240
|
+
includeCredentialsInPasswordResetLink,
|
|
241
|
+
includeCredentialsInVerificationLink
|
|
222
242
|
});
|
|
223
243
|
if (data) {
|
|
224
244
|
setEmailVerificationUrl(data.emailVerificationUrl || emailVerificationUrl);
|
|
225
245
|
setEmailVerificationEmailSubject(data.emailVerificationEmailSubject || emailVerificationEmailSubject);
|
|
246
|
+
setIncludeCredentialsInVerificationLink(
|
|
247
|
+
data.includeCredentialsInVerificationLink ?? includeCredentialsInVerificationLink
|
|
248
|
+
);
|
|
226
249
|
}
|
|
227
250
|
setLoading(false);
|
|
228
251
|
toggleNotification({
|
|
@@ -260,7 +283,9 @@ function SettingsPage() {
|
|
|
260
283
|
magicLinkEmailSubject,
|
|
261
284
|
magicLinkExpiryHours,
|
|
262
285
|
emailVerificationUrl,
|
|
263
|
-
emailVerificationEmailSubject
|
|
286
|
+
emailVerificationEmailSubject,
|
|
287
|
+
includeCredentialsInPasswordResetLink,
|
|
288
|
+
includeCredentialsInVerificationLink
|
|
264
289
|
});
|
|
265
290
|
if (!data || !data.firebase_config_json) {
|
|
266
291
|
throw new Error("Invalid response from server");
|
|
@@ -295,7 +320,9 @@ function SettingsPage() {
|
|
|
295
320
|
magicLinkEmailSubject,
|
|
296
321
|
magicLinkExpiryHours,
|
|
297
322
|
emailVerificationUrl,
|
|
298
|
-
emailVerificationEmailSubject
|
|
323
|
+
emailVerificationEmailSubject,
|
|
324
|
+
includeCredentialsInPasswordResetLink,
|
|
325
|
+
includeCredentialsInVerificationLink
|
|
299
326
|
});
|
|
300
327
|
if (!data || !data.firebase_config_json) {
|
|
301
328
|
throw new Error("Invalid response from server");
|
|
@@ -677,6 +704,20 @@ function SettingsPage() {
|
|
|
677
704
|
}
|
|
678
705
|
)
|
|
679
706
|
] }),
|
|
707
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.R, { marginBottom: 3, children: [
|
|
708
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Include Login Credentials in Link" }),
|
|
709
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { alignItems: "center", gap: 2, children: [
|
|
710
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
711
|
+
api.D1,
|
|
712
|
+
{
|
|
713
|
+
name: "includeCredentialsInPasswordResetLink",
|
|
714
|
+
checked: includeCredentialsInPasswordResetLink,
|
|
715
|
+
onChange: (e) => setIncludeCredentialsInPasswordResetLink(e.target.checked)
|
|
716
|
+
}
|
|
717
|
+
),
|
|
718
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "omega", textColor: "neutral600", children: "Append a Firebase custom token to the reset link, allowing users to be automatically logged in" })
|
|
719
|
+
] })
|
|
720
|
+
] }),
|
|
680
721
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
681
722
|
api.T,
|
|
682
723
|
{
|
|
@@ -727,6 +768,20 @@ function SettingsPage() {
|
|
|
727
768
|
}
|
|
728
769
|
)
|
|
729
770
|
] }),
|
|
771
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.R, { marginBottom: 3, children: [
|
|
772
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Include Login Credentials in Link" }),
|
|
773
|
+
/* @__PURE__ */ jsxRuntime.jsxs(api.T, { alignItems: "center", gap: 2, children: [
|
|
774
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
775
|
+
api.D1,
|
|
776
|
+
{
|
|
777
|
+
name: "includeCredentialsInVerificationLink",
|
|
778
|
+
checked: includeCredentialsInVerificationLink,
|
|
779
|
+
onChange: (e) => setIncludeCredentialsInVerificationLink(e.target.checked)
|
|
780
|
+
}
|
|
781
|
+
),
|
|
782
|
+
/* @__PURE__ */ jsxRuntime.jsx(api.E, { variant: "omega", textColor: "neutral600", children: "Append a Firebase custom token to the verification link, allowing users to be automatically logged in" })
|
|
783
|
+
] })
|
|
784
|
+
] }),
|
|
730
785
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
731
786
|
api.T,
|
|
732
787
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
-
import { T, R, E, J as Jm, N as Nn, G as G0, I as Is, M as M1, D as D1, i as i1, t as t1, g as getFirebaseConfig, s as saveFirebaseConfig, f as delFirebaseConfig, j as savePasswordSettings } from "./api-
|
|
3
|
+
import { T, R, E, J as Jm, N as Nn, G as G0, I as Is, M as M1, D as D1, i as i1, t as t1, g as getFirebaseConfig, s as saveFirebaseConfig, f as delFirebaseConfig, j as savePasswordSettings } from "./api-CLQa5PFi.mjs";
|
|
4
4
|
import { useNotification, Page } from "@strapi/strapi/admin";
|
|
5
5
|
import { useNavigate } from "react-router-dom";
|
|
6
6
|
function SettingsPage() {
|
|
@@ -23,6 +23,8 @@ function SettingsPage() {
|
|
|
23
23
|
"http://localhost:3000/verify-email"
|
|
24
24
|
);
|
|
25
25
|
const [emailVerificationEmailSubject, setEmailVerificationEmailSubject] = useState("Verify Your Email");
|
|
26
|
+
const [includeCredentialsInPasswordResetLink, setIncludeCredentialsInPasswordResetLink] = useState(false);
|
|
27
|
+
const [includeCredentialsInVerificationLink, setIncludeCredentialsInVerificationLink] = useState(false);
|
|
26
28
|
const [loading, setLoading] = useState(true);
|
|
27
29
|
const [showEditModal, setShowEditModal] = useState(false);
|
|
28
30
|
const [editWebApiKey, setEditWebApiKey] = useState("");
|
|
@@ -51,6 +53,8 @@ function SettingsPage() {
|
|
|
51
53
|
setMagicLinkExpiryHours(data?.magicLinkExpiryHours || 1);
|
|
52
54
|
setEmailVerificationUrl(data?.emailVerificationUrl || "http://localhost:3000/verify-email");
|
|
53
55
|
setEmailVerificationEmailSubject(data?.emailVerificationEmailSubject || "Verify Your Email");
|
|
56
|
+
setIncludeCredentialsInPasswordResetLink(data?.includeCredentialsInPasswordResetLink || false);
|
|
57
|
+
setIncludeCredentialsInVerificationLink(data?.includeCredentialsInVerificationLink || false);
|
|
54
58
|
}).catch((error) => {
|
|
55
59
|
setLoading(false);
|
|
56
60
|
console.error("Error retrieving Firebase config:", error);
|
|
@@ -78,6 +82,8 @@ function SettingsPage() {
|
|
|
78
82
|
setMagicLinkExpiryHours(1);
|
|
79
83
|
setEmailVerificationUrl("http://localhost:3000/verify-email");
|
|
80
84
|
setEmailVerificationEmailSubject("Verify Your Email");
|
|
85
|
+
setIncludeCredentialsInPasswordResetLink(false);
|
|
86
|
+
setIncludeCredentialsInVerificationLink(false);
|
|
81
87
|
setLoading(false);
|
|
82
88
|
toggleNotification({
|
|
83
89
|
type: "success",
|
|
@@ -105,7 +111,9 @@ function SettingsPage() {
|
|
|
105
111
|
magicLinkEmailSubject,
|
|
106
112
|
magicLinkExpiryHours,
|
|
107
113
|
emailVerificationUrl,
|
|
108
|
-
emailVerificationEmailSubject
|
|
114
|
+
emailVerificationEmailSubject,
|
|
115
|
+
includeCredentialsInPasswordResetLink,
|
|
116
|
+
includeCredentialsInVerificationLink
|
|
109
117
|
});
|
|
110
118
|
if (!data || !data.firebase_config_json) {
|
|
111
119
|
throw new Error("Invalid response from server");
|
|
@@ -138,7 +146,9 @@ function SettingsPage() {
|
|
|
138
146
|
magicLinkEmailSubject,
|
|
139
147
|
magicLinkExpiryHours,
|
|
140
148
|
emailVerificationUrl,
|
|
141
|
-
emailVerificationEmailSubject
|
|
149
|
+
emailVerificationEmailSubject,
|
|
150
|
+
includeCredentialsInPasswordResetLink,
|
|
151
|
+
includeCredentialsInVerificationLink
|
|
142
152
|
});
|
|
143
153
|
if (data) {
|
|
144
154
|
setPasswordRequirementsRegex(data.passwordRequirementsRegex || passwordRequirementsRegex);
|
|
@@ -151,6 +161,12 @@ function SettingsPage() {
|
|
|
151
161
|
setMagicLinkExpiryHours(data.magicLinkExpiryHours || magicLinkExpiryHours);
|
|
152
162
|
setEmailVerificationUrl(data.emailVerificationUrl || emailVerificationUrl);
|
|
153
163
|
setEmailVerificationEmailSubject(data.emailVerificationEmailSubject || emailVerificationEmailSubject);
|
|
164
|
+
setIncludeCredentialsInPasswordResetLink(
|
|
165
|
+
data.includeCredentialsInPasswordResetLink ?? includeCredentialsInPasswordResetLink
|
|
166
|
+
);
|
|
167
|
+
setIncludeCredentialsInVerificationLink(
|
|
168
|
+
data.includeCredentialsInVerificationLink ?? includeCredentialsInVerificationLink
|
|
169
|
+
);
|
|
154
170
|
}
|
|
155
171
|
setLoading(false);
|
|
156
172
|
toggleNotification({
|
|
@@ -179,7 +195,9 @@ function SettingsPage() {
|
|
|
179
195
|
magicLinkEmailSubject,
|
|
180
196
|
magicLinkExpiryHours,
|
|
181
197
|
emailVerificationUrl,
|
|
182
|
-
emailVerificationEmailSubject
|
|
198
|
+
emailVerificationEmailSubject,
|
|
199
|
+
includeCredentialsInPasswordResetLink,
|
|
200
|
+
includeCredentialsInVerificationLink
|
|
183
201
|
});
|
|
184
202
|
if (data) {
|
|
185
203
|
setEnableMagicLink(data.enableMagicLink || enableMagicLink);
|
|
@@ -216,11 +234,16 @@ function SettingsPage() {
|
|
|
216
234
|
magicLinkEmailSubject,
|
|
217
235
|
magicLinkExpiryHours,
|
|
218
236
|
emailVerificationUrl,
|
|
219
|
-
emailVerificationEmailSubject
|
|
237
|
+
emailVerificationEmailSubject,
|
|
238
|
+
includeCredentialsInPasswordResetLink,
|
|
239
|
+
includeCredentialsInVerificationLink
|
|
220
240
|
});
|
|
221
241
|
if (data) {
|
|
222
242
|
setEmailVerificationUrl(data.emailVerificationUrl || emailVerificationUrl);
|
|
223
243
|
setEmailVerificationEmailSubject(data.emailVerificationEmailSubject || emailVerificationEmailSubject);
|
|
244
|
+
setIncludeCredentialsInVerificationLink(
|
|
245
|
+
data.includeCredentialsInVerificationLink ?? includeCredentialsInVerificationLink
|
|
246
|
+
);
|
|
224
247
|
}
|
|
225
248
|
setLoading(false);
|
|
226
249
|
toggleNotification({
|
|
@@ -258,7 +281,9 @@ function SettingsPage() {
|
|
|
258
281
|
magicLinkEmailSubject,
|
|
259
282
|
magicLinkExpiryHours,
|
|
260
283
|
emailVerificationUrl,
|
|
261
|
-
emailVerificationEmailSubject
|
|
284
|
+
emailVerificationEmailSubject,
|
|
285
|
+
includeCredentialsInPasswordResetLink,
|
|
286
|
+
includeCredentialsInVerificationLink
|
|
262
287
|
});
|
|
263
288
|
if (!data || !data.firebase_config_json) {
|
|
264
289
|
throw new Error("Invalid response from server");
|
|
@@ -293,7 +318,9 @@ function SettingsPage() {
|
|
|
293
318
|
magicLinkEmailSubject,
|
|
294
319
|
magicLinkExpiryHours,
|
|
295
320
|
emailVerificationUrl,
|
|
296
|
-
emailVerificationEmailSubject
|
|
321
|
+
emailVerificationEmailSubject,
|
|
322
|
+
includeCredentialsInPasswordResetLink,
|
|
323
|
+
includeCredentialsInVerificationLink
|
|
297
324
|
});
|
|
298
325
|
if (!data || !data.firebase_config_json) {
|
|
299
326
|
throw new Error("Invalid response from server");
|
|
@@ -675,6 +702,20 @@ function SettingsPage() {
|
|
|
675
702
|
}
|
|
676
703
|
)
|
|
677
704
|
] }),
|
|
705
|
+
/* @__PURE__ */ jsxs(R, { marginBottom: 3, children: [
|
|
706
|
+
/* @__PURE__ */ jsx(E, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Include Login Credentials in Link" }),
|
|
707
|
+
/* @__PURE__ */ jsxs(T, { alignItems: "center", gap: 2, children: [
|
|
708
|
+
/* @__PURE__ */ jsx(
|
|
709
|
+
D1,
|
|
710
|
+
{
|
|
711
|
+
name: "includeCredentialsInPasswordResetLink",
|
|
712
|
+
checked: includeCredentialsInPasswordResetLink,
|
|
713
|
+
onChange: (e) => setIncludeCredentialsInPasswordResetLink(e.target.checked)
|
|
714
|
+
}
|
|
715
|
+
),
|
|
716
|
+
/* @__PURE__ */ jsx(E, { variant: "omega", textColor: "neutral600", children: "Append a Firebase custom token to the reset link, allowing users to be automatically logged in" })
|
|
717
|
+
] })
|
|
718
|
+
] }),
|
|
678
719
|
/* @__PURE__ */ jsx(
|
|
679
720
|
T,
|
|
680
721
|
{
|
|
@@ -725,6 +766,20 @@ function SettingsPage() {
|
|
|
725
766
|
}
|
|
726
767
|
)
|
|
727
768
|
] }),
|
|
769
|
+
/* @__PURE__ */ jsxs(R, { marginBottom: 3, children: [
|
|
770
|
+
/* @__PURE__ */ jsx(E, { variant: "omega", fontWeight: "bold", style: { display: "block", marginBottom: "8px" }, children: "Include Login Credentials in Link" }),
|
|
771
|
+
/* @__PURE__ */ jsxs(T, { alignItems: "center", gap: 2, children: [
|
|
772
|
+
/* @__PURE__ */ jsx(
|
|
773
|
+
D1,
|
|
774
|
+
{
|
|
775
|
+
name: "includeCredentialsInVerificationLink",
|
|
776
|
+
checked: includeCredentialsInVerificationLink,
|
|
777
|
+
onChange: (e) => setIncludeCredentialsInVerificationLink(e.target.checked)
|
|
778
|
+
}
|
|
779
|
+
),
|
|
780
|
+
/* @__PURE__ */ jsx(E, { variant: "omega", textColor: "neutral600", children: "Append a Firebase custom token to the verification link, allowing users to be automatically logged in" })
|
|
781
|
+
] })
|
|
782
|
+
] }),
|
|
728
783
|
/* @__PURE__ */ jsx(
|
|
729
784
|
T,
|
|
730
785
|
{
|
|
@@ -2663,7 +2663,7 @@ const index = {
|
|
|
2663
2663
|
id: `${PLUGIN_ID}.page.title`,
|
|
2664
2664
|
defaultMessage: PLUGIN_ID
|
|
2665
2665
|
},
|
|
2666
|
-
Component: () => Promise.resolve().then(() => require("./App-
|
|
2666
|
+
Component: () => Promise.resolve().then(() => require("./App-BmP-duLn.js")).then((mod) => ({
|
|
2667
2667
|
default: mod.App
|
|
2668
2668
|
})),
|
|
2669
2669
|
permissions: PERMISSIONS["menu-link"]
|
|
@@ -2685,7 +2685,7 @@ const index = {
|
|
|
2685
2685
|
id: "settings",
|
|
2686
2686
|
to: `/settings/${PLUGIN_ID}`,
|
|
2687
2687
|
async Component() {
|
|
2688
|
-
const component = await Promise.resolve().then(() => require("./index-
|
|
2688
|
+
const component = await Promise.resolve().then(() => require("./index-B4ptk_Em.js"));
|
|
2689
2689
|
return component.default;
|
|
2690
2690
|
},
|
|
2691
2691
|
permissions: PERMISSIONS["menu-link"]
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
|
@@ -10,6 +10,8 @@ export declare const saveFirebaseConfig: (json: string, firebaseWebApiKey?: stri
|
|
|
10
10
|
magicLinkExpiryHours?: number;
|
|
11
11
|
emailVerificationUrl?: string;
|
|
12
12
|
emailVerificationEmailSubject?: string;
|
|
13
|
+
includeCredentialsInPasswordResetLink?: boolean;
|
|
14
|
+
includeCredentialsInVerificationLink?: boolean;
|
|
13
15
|
}) => Promise<any>;
|
|
14
16
|
export declare const getFirebaseConfig: () => Promise<any>;
|
|
15
17
|
export declare const delFirebaseConfig: () => Promise<any>;
|
|
@@ -24,4 +26,6 @@ export declare const savePasswordSettings: (passwordConfig: {
|
|
|
24
26
|
magicLinkExpiryHours?: number;
|
|
25
27
|
emailVerificationUrl?: string;
|
|
26
28
|
emailVerificationEmailSubject?: string;
|
|
29
|
+
includeCredentialsInPasswordResetLink?: boolean;
|
|
30
|
+
includeCredentialsInVerificationLink?: boolean;
|
|
27
31
|
}) => Promise<any>;
|
package/dist/server/index.js
CHANGED
|
@@ -330,6 +330,16 @@ const attributes$1 = {
|
|
|
330
330
|
emailVerificationEmailSubject: {
|
|
331
331
|
type: "string",
|
|
332
332
|
"default": "Verify Your Email"
|
|
333
|
+
},
|
|
334
|
+
includeCredentialsInPasswordResetLink: {
|
|
335
|
+
type: "boolean",
|
|
336
|
+
"default": false,
|
|
337
|
+
description: "Include Firebase custom token in password reset links for auto-login"
|
|
338
|
+
},
|
|
339
|
+
includeCredentialsInVerificationLink: {
|
|
340
|
+
type: "boolean",
|
|
341
|
+
"default": false,
|
|
342
|
+
description: "Include Firebase custom token in email verification links for auto-login"
|
|
333
343
|
}
|
|
334
344
|
};
|
|
335
345
|
const firebaseAuthenticationConfiguration = {
|
|
@@ -29196,7 +29206,9 @@ const settingsController = {
|
|
|
29196
29206
|
magicLinkEmailSubject = "Sign in to Your Application",
|
|
29197
29207
|
magicLinkExpiryHours = 1,
|
|
29198
29208
|
emailVerificationUrl = "http://localhost:3000/verify-email",
|
|
29199
|
-
emailVerificationEmailSubject = "Verify Your Email"
|
|
29209
|
+
emailVerificationEmailSubject = "Verify Your Email",
|
|
29210
|
+
includeCredentialsInPasswordResetLink = false,
|
|
29211
|
+
includeCredentialsInVerificationLink = false
|
|
29200
29212
|
} = requestBody;
|
|
29201
29213
|
const existingConfig = await strapi.db.query("plugin::firebase-authentication.firebase-authentication-configuration").findOne({ where: {} });
|
|
29202
29214
|
let result;
|
|
@@ -29212,7 +29224,9 @@ const settingsController = {
|
|
|
29212
29224
|
magicLinkEmailSubject,
|
|
29213
29225
|
magicLinkExpiryHours,
|
|
29214
29226
|
emailVerificationUrl,
|
|
29215
|
-
emailVerificationEmailSubject
|
|
29227
|
+
emailVerificationEmailSubject,
|
|
29228
|
+
includeCredentialsInPasswordResetLink,
|
|
29229
|
+
includeCredentialsInVerificationLink
|
|
29216
29230
|
}
|
|
29217
29231
|
});
|
|
29218
29232
|
} else {
|
|
@@ -29228,7 +29242,9 @@ const settingsController = {
|
|
|
29228
29242
|
magicLinkEmailSubject,
|
|
29229
29243
|
magicLinkExpiryHours,
|
|
29230
29244
|
emailVerificationUrl,
|
|
29231
|
-
emailVerificationEmailSubject
|
|
29245
|
+
emailVerificationEmailSubject,
|
|
29246
|
+
includeCredentialsInPasswordResetLink,
|
|
29247
|
+
includeCredentialsInVerificationLink
|
|
29232
29248
|
}
|
|
29233
29249
|
});
|
|
29234
29250
|
}
|
|
@@ -29242,7 +29258,9 @@ const settingsController = {
|
|
|
29242
29258
|
magicLinkEmailSubject: result.magicLinkEmailSubject,
|
|
29243
29259
|
magicLinkExpiryHours: result.magicLinkExpiryHours,
|
|
29244
29260
|
emailVerificationUrl: result.emailVerificationUrl,
|
|
29245
|
-
emailVerificationEmailSubject: result.emailVerificationEmailSubject
|
|
29261
|
+
emailVerificationEmailSubject: result.emailVerificationEmailSubject,
|
|
29262
|
+
includeCredentialsInPasswordResetLink: result.includeCredentialsInPasswordResetLink,
|
|
29263
|
+
includeCredentialsInVerificationLink: result.includeCredentialsInVerificationLink
|
|
29246
29264
|
};
|
|
29247
29265
|
} catch (error2) {
|
|
29248
29266
|
throw new ApplicationError$2("Error saving password configuration", {
|
|
@@ -29589,7 +29607,10 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29589
29607
|
magicLinkExpiryHours: configObject.magicLinkExpiryHours || 1,
|
|
29590
29608
|
// Include email verification configuration fields
|
|
29591
29609
|
emailVerificationUrl: configObject.emailVerificationUrl || "http://localhost:3000/verify-email",
|
|
29592
|
-
emailVerificationEmailSubject: configObject.emailVerificationEmailSubject || "Verify Your Email"
|
|
29610
|
+
emailVerificationEmailSubject: configObject.emailVerificationEmailSubject || "Verify Your Email",
|
|
29611
|
+
// Include credentials in link settings
|
|
29612
|
+
includeCredentialsInPasswordResetLink: configObject.includeCredentialsInPasswordResetLink || false,
|
|
29613
|
+
includeCredentialsInVerificationLink: configObject.includeCredentialsInVerificationLink || false
|
|
29593
29614
|
};
|
|
29594
29615
|
} catch (error2) {
|
|
29595
29616
|
strapi2.log.error(`Firebase config error: ${error2.message}`);
|
|
@@ -29634,7 +29655,9 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29634
29655
|
magicLinkEmailSubject = "Sign in to Your Application",
|
|
29635
29656
|
magicLinkExpiryHours = 1,
|
|
29636
29657
|
emailVerificationUrl = "http://localhost:3000/verify-email",
|
|
29637
|
-
emailVerificationEmailSubject = "Verify Your Email"
|
|
29658
|
+
emailVerificationEmailSubject = "Verify Your Email",
|
|
29659
|
+
includeCredentialsInPasswordResetLink = false,
|
|
29660
|
+
includeCredentialsInVerificationLink = false
|
|
29638
29661
|
} = requestBody;
|
|
29639
29662
|
if (!requestBody) throw new ValidationError3(ERROR_MESSAGES.MISSING_DATA);
|
|
29640
29663
|
try {
|
|
@@ -29672,7 +29695,9 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29672
29695
|
magicLinkEmailSubject,
|
|
29673
29696
|
magicLinkExpiryHours,
|
|
29674
29697
|
emailVerificationUrl,
|
|
29675
|
-
emailVerificationEmailSubject
|
|
29698
|
+
emailVerificationEmailSubject,
|
|
29699
|
+
includeCredentialsInPasswordResetLink,
|
|
29700
|
+
includeCredentialsInVerificationLink
|
|
29676
29701
|
}
|
|
29677
29702
|
});
|
|
29678
29703
|
} else {
|
|
@@ -29690,7 +29715,9 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29690
29715
|
magicLinkEmailSubject,
|
|
29691
29716
|
magicLinkExpiryHours,
|
|
29692
29717
|
emailVerificationUrl,
|
|
29693
|
-
emailVerificationEmailSubject
|
|
29718
|
+
emailVerificationEmailSubject,
|
|
29719
|
+
includeCredentialsInPasswordResetLink,
|
|
29720
|
+
includeCredentialsInVerificationLink
|
|
29694
29721
|
}
|
|
29695
29722
|
});
|
|
29696
29723
|
}
|
|
@@ -29727,6 +29754,8 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29727
29754
|
res.magicLinkExpiryHours = res.magicLinkExpiryHours || magicLinkExpiryHours;
|
|
29728
29755
|
res.emailVerificationUrl = res.emailVerificationUrl || emailVerificationUrl;
|
|
29729
29756
|
res.emailVerificationEmailSubject = res.emailVerificationEmailSubject || emailVerificationEmailSubject;
|
|
29757
|
+
res.includeCredentialsInPasswordResetLink = res.includeCredentialsInPasswordResetLink ?? includeCredentialsInPasswordResetLink;
|
|
29758
|
+
res.includeCredentialsInVerificationLink = res.includeCredentialsInVerificationLink ?? includeCredentialsInVerificationLink;
|
|
29730
29759
|
return res;
|
|
29731
29760
|
} catch (error2) {
|
|
29732
29761
|
strapi2.log.error("=== FIREBASE CONFIG SAVE ERROR ===");
|
|
@@ -30927,7 +30956,16 @@ const firebaseService = ({ strapi: strapi2 }) => ({
|
|
|
30927
30956
|
);
|
|
30928
30957
|
const tokenService2 = strapi2.plugin("firebase-authentication").service("tokenService");
|
|
30929
30958
|
const token = await tokenService2.generateResetToken(firebaseData.documentId);
|
|
30930
|
-
|
|
30959
|
+
let resetLink = `${resetUrl}?token=${token}`;
|
|
30960
|
+
if (config2?.includeCredentialsInPasswordResetLink) {
|
|
30961
|
+
try {
|
|
30962
|
+
const customToken = await strapi2.firebase.auth().createCustomToken(firebaseUser.uid);
|
|
30963
|
+
resetLink = `${resetLink}&fjwt=${customToken}`;
|
|
30964
|
+
strapi2.log.info(`[forgotPassword] Added Firebase custom token to reset link`);
|
|
30965
|
+
} catch (tokenError) {
|
|
30966
|
+
strapi2.log.warn(`[forgotPassword] Could not generate custom token: ${tokenError.message}`);
|
|
30967
|
+
}
|
|
30968
|
+
}
|
|
30931
30969
|
strapi2.log.info(`✅ [forgotPassword] Custom reset link generated for ${email2}`);
|
|
30932
30970
|
strapi2.log.info(`[forgotPassword] Attempting to send password reset email to: ${email2}`);
|
|
30933
30971
|
await strapi2.plugin("firebase-authentication").service("emailService").sendPasswordResetEmail(firebaseUser, resetLink);
|
|
@@ -31152,7 +31190,16 @@ const firebaseService = ({ strapi: strapi2 }) => ({
|
|
|
31152
31190
|
);
|
|
31153
31191
|
const tokenService2 = strapi2.plugin("firebase-authentication").service("tokenService");
|
|
31154
31192
|
const token = await tokenService2.generateVerificationToken(firebaseData.documentId, email2);
|
|
31155
|
-
|
|
31193
|
+
let verificationLink = `${verificationUrl}?token=${token}`;
|
|
31194
|
+
if (config2?.includeCredentialsInVerificationLink) {
|
|
31195
|
+
try {
|
|
31196
|
+
const customToken = await strapi2.firebase.auth().createCustomToken(firebaseUser.uid);
|
|
31197
|
+
verificationLink = `${verificationLink}&fjwt=${customToken}`;
|
|
31198
|
+
strapi2.log.info(`[sendVerificationEmail] Added Firebase custom token to verification link`);
|
|
31199
|
+
} catch (tokenError) {
|
|
31200
|
+
strapi2.log.warn(`[sendVerificationEmail] Could not generate custom token: ${tokenError.message}`);
|
|
31201
|
+
}
|
|
31202
|
+
}
|
|
31156
31203
|
strapi2.log.info(`✅ [sendVerificationEmail] Verification link generated for ${email2}`);
|
|
31157
31204
|
strapi2.log.info(`[sendVerificationEmail] Attempting to send verification email to: ${email2}`);
|
|
31158
31205
|
await strapi2.plugin("firebase-authentication").service("emailService").sendVerificationEmail(firebaseUser, verificationLink);
|
package/dist/server/index.mjs
CHANGED
|
@@ -298,6 +298,16 @@ const attributes$1 = {
|
|
|
298
298
|
emailVerificationEmailSubject: {
|
|
299
299
|
type: "string",
|
|
300
300
|
"default": "Verify Your Email"
|
|
301
|
+
},
|
|
302
|
+
includeCredentialsInPasswordResetLink: {
|
|
303
|
+
type: "boolean",
|
|
304
|
+
"default": false,
|
|
305
|
+
description: "Include Firebase custom token in password reset links for auto-login"
|
|
306
|
+
},
|
|
307
|
+
includeCredentialsInVerificationLink: {
|
|
308
|
+
type: "boolean",
|
|
309
|
+
"default": false,
|
|
310
|
+
description: "Include Firebase custom token in email verification links for auto-login"
|
|
301
311
|
}
|
|
302
312
|
};
|
|
303
313
|
const firebaseAuthenticationConfiguration = {
|
|
@@ -29164,7 +29174,9 @@ const settingsController = {
|
|
|
29164
29174
|
magicLinkEmailSubject = "Sign in to Your Application",
|
|
29165
29175
|
magicLinkExpiryHours = 1,
|
|
29166
29176
|
emailVerificationUrl = "http://localhost:3000/verify-email",
|
|
29167
|
-
emailVerificationEmailSubject = "Verify Your Email"
|
|
29177
|
+
emailVerificationEmailSubject = "Verify Your Email",
|
|
29178
|
+
includeCredentialsInPasswordResetLink = false,
|
|
29179
|
+
includeCredentialsInVerificationLink = false
|
|
29168
29180
|
} = requestBody;
|
|
29169
29181
|
const existingConfig = await strapi.db.query("plugin::firebase-authentication.firebase-authentication-configuration").findOne({ where: {} });
|
|
29170
29182
|
let result;
|
|
@@ -29180,7 +29192,9 @@ const settingsController = {
|
|
|
29180
29192
|
magicLinkEmailSubject,
|
|
29181
29193
|
magicLinkExpiryHours,
|
|
29182
29194
|
emailVerificationUrl,
|
|
29183
|
-
emailVerificationEmailSubject
|
|
29195
|
+
emailVerificationEmailSubject,
|
|
29196
|
+
includeCredentialsInPasswordResetLink,
|
|
29197
|
+
includeCredentialsInVerificationLink
|
|
29184
29198
|
}
|
|
29185
29199
|
});
|
|
29186
29200
|
} else {
|
|
@@ -29196,7 +29210,9 @@ const settingsController = {
|
|
|
29196
29210
|
magicLinkEmailSubject,
|
|
29197
29211
|
magicLinkExpiryHours,
|
|
29198
29212
|
emailVerificationUrl,
|
|
29199
|
-
emailVerificationEmailSubject
|
|
29213
|
+
emailVerificationEmailSubject,
|
|
29214
|
+
includeCredentialsInPasswordResetLink,
|
|
29215
|
+
includeCredentialsInVerificationLink
|
|
29200
29216
|
}
|
|
29201
29217
|
});
|
|
29202
29218
|
}
|
|
@@ -29210,7 +29226,9 @@ const settingsController = {
|
|
|
29210
29226
|
magicLinkEmailSubject: result.magicLinkEmailSubject,
|
|
29211
29227
|
magicLinkExpiryHours: result.magicLinkExpiryHours,
|
|
29212
29228
|
emailVerificationUrl: result.emailVerificationUrl,
|
|
29213
|
-
emailVerificationEmailSubject: result.emailVerificationEmailSubject
|
|
29229
|
+
emailVerificationEmailSubject: result.emailVerificationEmailSubject,
|
|
29230
|
+
includeCredentialsInPasswordResetLink: result.includeCredentialsInPasswordResetLink,
|
|
29231
|
+
includeCredentialsInVerificationLink: result.includeCredentialsInVerificationLink
|
|
29214
29232
|
};
|
|
29215
29233
|
} catch (error2) {
|
|
29216
29234
|
throw new ApplicationError$2("Error saving password configuration", {
|
|
@@ -29557,7 +29575,10 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29557
29575
|
magicLinkExpiryHours: configObject.magicLinkExpiryHours || 1,
|
|
29558
29576
|
// Include email verification configuration fields
|
|
29559
29577
|
emailVerificationUrl: configObject.emailVerificationUrl || "http://localhost:3000/verify-email",
|
|
29560
|
-
emailVerificationEmailSubject: configObject.emailVerificationEmailSubject || "Verify Your Email"
|
|
29578
|
+
emailVerificationEmailSubject: configObject.emailVerificationEmailSubject || "Verify Your Email",
|
|
29579
|
+
// Include credentials in link settings
|
|
29580
|
+
includeCredentialsInPasswordResetLink: configObject.includeCredentialsInPasswordResetLink || false,
|
|
29581
|
+
includeCredentialsInVerificationLink: configObject.includeCredentialsInVerificationLink || false
|
|
29561
29582
|
};
|
|
29562
29583
|
} catch (error2) {
|
|
29563
29584
|
strapi2.log.error(`Firebase config error: ${error2.message}`);
|
|
@@ -29602,7 +29623,9 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29602
29623
|
magicLinkEmailSubject = "Sign in to Your Application",
|
|
29603
29624
|
magicLinkExpiryHours = 1,
|
|
29604
29625
|
emailVerificationUrl = "http://localhost:3000/verify-email",
|
|
29605
|
-
emailVerificationEmailSubject = "Verify Your Email"
|
|
29626
|
+
emailVerificationEmailSubject = "Verify Your Email",
|
|
29627
|
+
includeCredentialsInPasswordResetLink = false,
|
|
29628
|
+
includeCredentialsInVerificationLink = false
|
|
29606
29629
|
} = requestBody;
|
|
29607
29630
|
if (!requestBody) throw new ValidationError3(ERROR_MESSAGES.MISSING_DATA);
|
|
29608
29631
|
try {
|
|
@@ -29640,7 +29663,9 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29640
29663
|
magicLinkEmailSubject,
|
|
29641
29664
|
magicLinkExpiryHours,
|
|
29642
29665
|
emailVerificationUrl,
|
|
29643
|
-
emailVerificationEmailSubject
|
|
29666
|
+
emailVerificationEmailSubject,
|
|
29667
|
+
includeCredentialsInPasswordResetLink,
|
|
29668
|
+
includeCredentialsInVerificationLink
|
|
29644
29669
|
}
|
|
29645
29670
|
});
|
|
29646
29671
|
} else {
|
|
@@ -29658,7 +29683,9 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29658
29683
|
magicLinkEmailSubject,
|
|
29659
29684
|
magicLinkExpiryHours,
|
|
29660
29685
|
emailVerificationUrl,
|
|
29661
|
-
emailVerificationEmailSubject
|
|
29686
|
+
emailVerificationEmailSubject,
|
|
29687
|
+
includeCredentialsInPasswordResetLink,
|
|
29688
|
+
includeCredentialsInVerificationLink
|
|
29662
29689
|
}
|
|
29663
29690
|
});
|
|
29664
29691
|
}
|
|
@@ -29695,6 +29722,8 @@ const settingsService = ({ strapi: strapi2 }) => {
|
|
|
29695
29722
|
res.magicLinkExpiryHours = res.magicLinkExpiryHours || magicLinkExpiryHours;
|
|
29696
29723
|
res.emailVerificationUrl = res.emailVerificationUrl || emailVerificationUrl;
|
|
29697
29724
|
res.emailVerificationEmailSubject = res.emailVerificationEmailSubject || emailVerificationEmailSubject;
|
|
29725
|
+
res.includeCredentialsInPasswordResetLink = res.includeCredentialsInPasswordResetLink ?? includeCredentialsInPasswordResetLink;
|
|
29726
|
+
res.includeCredentialsInVerificationLink = res.includeCredentialsInVerificationLink ?? includeCredentialsInVerificationLink;
|
|
29698
29727
|
return res;
|
|
29699
29728
|
} catch (error2) {
|
|
29700
29729
|
strapi2.log.error("=== FIREBASE CONFIG SAVE ERROR ===");
|
|
@@ -30895,7 +30924,16 @@ const firebaseService = ({ strapi: strapi2 }) => ({
|
|
|
30895
30924
|
);
|
|
30896
30925
|
const tokenService2 = strapi2.plugin("firebase-authentication").service("tokenService");
|
|
30897
30926
|
const token = await tokenService2.generateResetToken(firebaseData.documentId);
|
|
30898
|
-
|
|
30927
|
+
let resetLink = `${resetUrl}?token=${token}`;
|
|
30928
|
+
if (config2?.includeCredentialsInPasswordResetLink) {
|
|
30929
|
+
try {
|
|
30930
|
+
const customToken = await strapi2.firebase.auth().createCustomToken(firebaseUser.uid);
|
|
30931
|
+
resetLink = `${resetLink}&fjwt=${customToken}`;
|
|
30932
|
+
strapi2.log.info(`[forgotPassword] Added Firebase custom token to reset link`);
|
|
30933
|
+
} catch (tokenError) {
|
|
30934
|
+
strapi2.log.warn(`[forgotPassword] Could not generate custom token: ${tokenError.message}`);
|
|
30935
|
+
}
|
|
30936
|
+
}
|
|
30899
30937
|
strapi2.log.info(`✅ [forgotPassword] Custom reset link generated for ${email2}`);
|
|
30900
30938
|
strapi2.log.info(`[forgotPassword] Attempting to send password reset email to: ${email2}`);
|
|
30901
30939
|
await strapi2.plugin("firebase-authentication").service("emailService").sendPasswordResetEmail(firebaseUser, resetLink);
|
|
@@ -31120,7 +31158,16 @@ const firebaseService = ({ strapi: strapi2 }) => ({
|
|
|
31120
31158
|
);
|
|
31121
31159
|
const tokenService2 = strapi2.plugin("firebase-authentication").service("tokenService");
|
|
31122
31160
|
const token = await tokenService2.generateVerificationToken(firebaseData.documentId, email2);
|
|
31123
|
-
|
|
31161
|
+
let verificationLink = `${verificationUrl}?token=${token}`;
|
|
31162
|
+
if (config2?.includeCredentialsInVerificationLink) {
|
|
31163
|
+
try {
|
|
31164
|
+
const customToken = await strapi2.firebase.auth().createCustomToken(firebaseUser.uid);
|
|
31165
|
+
verificationLink = `${verificationLink}&fjwt=${customToken}`;
|
|
31166
|
+
strapi2.log.info(`[sendVerificationEmail] Added Firebase custom token to verification link`);
|
|
31167
|
+
} catch (tokenError) {
|
|
31168
|
+
strapi2.log.warn(`[sendVerificationEmail] Could not generate custom token: ${tokenError.message}`);
|
|
31169
|
+
}
|
|
31170
|
+
}
|
|
31124
31171
|
strapi2.log.info(`✅ [sendVerificationEmail] Verification link generated for ${email2}`);
|
|
31125
31172
|
strapi2.log.info(`[sendVerificationEmail] Attempting to send verification email to: ${email2}`);
|
|
31126
31173
|
await strapi2.plugin("firebase-authentication").service("emailService").sendVerificationEmail(firebaseUser, verificationLink);
|
|
@@ -75,6 +75,16 @@ declare const _default: {
|
|
|
75
75
|
type: string;
|
|
76
76
|
default: string;
|
|
77
77
|
};
|
|
78
|
+
includeCredentialsInPasswordResetLink: {
|
|
79
|
+
type: string;
|
|
80
|
+
default: boolean;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
includeCredentialsInVerificationLink: {
|
|
84
|
+
type: string;
|
|
85
|
+
default: boolean;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
78
88
|
};
|
|
79
89
|
};
|
|
80
90
|
};
|
|
@@ -106,6 +106,8 @@ declare const _default: {
|
|
|
106
106
|
magicLinkExpiryHours: any;
|
|
107
107
|
emailVerificationUrl: any;
|
|
108
108
|
emailVerificationEmailSubject: any;
|
|
109
|
+
includeCredentialsInPasswordResetLink: any;
|
|
110
|
+
includeCredentialsInVerificationLink: any;
|
|
109
111
|
}>;
|
|
110
112
|
setFirebaseConfigJson(requestBody: any): Promise<any>;
|
|
111
113
|
delFirebaseConfigJson: () => Promise<any>;
|
|
@@ -344,6 +346,16 @@ declare const _default: {
|
|
|
344
346
|
type: string;
|
|
345
347
|
default: string;
|
|
346
348
|
};
|
|
349
|
+
includeCredentialsInPasswordResetLink: {
|
|
350
|
+
type: string;
|
|
351
|
+
default: boolean;
|
|
352
|
+
description: string;
|
|
353
|
+
};
|
|
354
|
+
includeCredentialsInVerificationLink: {
|
|
355
|
+
type: string;
|
|
356
|
+
default: boolean;
|
|
357
|
+
description: string;
|
|
358
|
+
};
|
|
347
359
|
};
|
|
348
360
|
};
|
|
349
361
|
};
|
|
@@ -17,6 +17,8 @@ declare const _default: {
|
|
|
17
17
|
magicLinkExpiryHours: any;
|
|
18
18
|
emailVerificationUrl: any;
|
|
19
19
|
emailVerificationEmailSubject: any;
|
|
20
|
+
includeCredentialsInPasswordResetLink: any;
|
|
21
|
+
includeCredentialsInVerificationLink: any;
|
|
20
22
|
}>;
|
|
21
23
|
setFirebaseConfigJson(requestBody: any): Promise<any>;
|
|
22
24
|
delFirebaseConfigJson: () => Promise<any>;
|
|
@@ -31,6 +31,8 @@ declare const _default: ({ strapi }: {
|
|
|
31
31
|
magicLinkExpiryHours: any;
|
|
32
32
|
emailVerificationUrl: any;
|
|
33
33
|
emailVerificationEmailSubject: any;
|
|
34
|
+
includeCredentialsInPasswordResetLink: any;
|
|
35
|
+
includeCredentialsInVerificationLink: any;
|
|
34
36
|
}>;
|
|
35
37
|
/**
|
|
36
38
|
* Stores and encrypts Firebase configuration including Web API key and password reset settings
|
package/package.json
CHANGED