@infuro/cms-core 1.0.67 → 1.0.69
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/{OrderTrackPage-W3J6WIG2.js → OrderTrackPage-VBZUVZOU.js} +1 -1
- package/dist/{OrderTrackPage-Z6FCJQYY.cjs → OrderTrackPage-VFIXWJOW.cjs} +4 -4
- package/dist/admin.cjs +121 -12
- package/dist/admin.js +121 -12
- package/dist/api.cjs +57 -54
- package/dist/api.js +24 -21
- package/dist/auth.cjs +62 -62
- package/dist/auth.js +6 -6
- package/dist/{chunk-XJNNOSJR.js → chunk-2BNVRFUQ.js} +1 -1
- package/dist/chunk-2JHGIWH7.cjs +2700 -0
- package/dist/{chunk-3DZRIZOD.cjs → chunk-3ASNJS2H.cjs} +3 -3
- package/dist/{chunk-7NMT3GBR.cjs → chunk-3LQS4ATQ.cjs} +4 -4
- package/dist/{chunk-GWDI752Q.js → chunk-3XCTGADT.js} +1 -1
- package/dist/chunk-47G65M5Q.cjs +18 -0
- package/dist/{chunk-XFDIIVZB.cjs → chunk-4MNVIGVJ.cjs} +11 -11
- package/dist/{chunk-OY2YTBMP.cjs → chunk-4WZNRVEZ.cjs} +3 -3
- package/dist/{chunk-OVTOP42W.js → chunk-53AMBXMM.js} +1 -1
- package/dist/chunk-5BKT4CS5.js +28 -0
- package/dist/chunk-5DSY3GQI.js +16 -0
- package/dist/{chunk-AYERBA7I.js → chunk-5NVGWJSY.js} +1 -1
- package/dist/{chunk-HF3L2GIT.cjs → chunk-5YMKJ3TH.cjs} +16 -16
- package/dist/{chunk-WFMVD567.cjs → chunk-6MM5OMRL.cjs} +11 -11
- package/dist/{chunk-5MZFQRDW.cjs → chunk-747MJJCZ.cjs} +147 -147
- package/dist/{chunk-SYBOCAWB.js → chunk-7QJI56OL.js} +1 -1
- package/dist/{chunk-DBPSJYLZ.js → chunk-BK5XW5XH.js} +1 -1
- package/dist/chunk-BQQMTQ4C.cjs +455 -0
- package/dist/{chunk-6YOQ7G5O.js → chunk-CFUSYGSA.js} +1 -1
- package/dist/{chunk-OOTLNH63.cjs → chunk-CIZZX57T.cjs} +2 -2
- package/dist/{chunk-7L6KWI7S.cjs → chunk-CTTV375J.cjs} +13 -13
- package/dist/{chunk-ZY64VJMS.js → chunk-D4LR3S77.js} +2 -2
- package/dist/{chunk-GLLCLRCQ.js → chunk-DBBYLSQP.js} +179 -49
- package/dist/{chunk-5NOZSG6J.js → chunk-DWNQTFJ5.js} +2 -2
- package/dist/{chunk-2IAXTKQN.cjs → chunk-DZNWS2MM.cjs} +2 -2
- package/dist/chunk-E62LKM6Z.cjs +49 -0
- package/dist/{chunk-CRFV5WJK.js → chunk-ECNYZG6T.js} +1 -1
- package/dist/{chunk-TZEMLHSP.cjs → chunk-EYUBL7YH.cjs} +7 -7
- package/dist/{chunk-WMMZZRDJ.cjs → chunk-HGR4IA7I.cjs} +18 -18
- package/dist/{chunk-TJ2MIQUT.cjs → chunk-JRW3GQD4.cjs} +4 -4
- package/dist/{chunk-3K5AIEIZ.js → chunk-JYRFSFXH.js} +1 -1
- package/dist/chunk-K6RXCLD5.js +45 -0
- package/dist/{chunk-TU23GJPJ.js → chunk-LJ5C4RBF.js} +3 -3
- package/dist/{chunk-O4AFPDQ4.cjs → chunk-LXWF6T7F.cjs} +33 -33
- package/dist/{chunk-EIZKW2PF.js → chunk-LY7CDNC6.js} +1 -1
- package/dist/{chunk-PA6YDMFZ.cjs → chunk-M5QDJOUP.cjs} +12 -12
- package/dist/{chunk-MQBT33IV.js → chunk-MGT4DJ2D.js} +1 -1
- package/dist/{chunk-2ISSXYBZ.js → chunk-MJDNS324.js} +5 -5
- package/dist/{chunk-H3IVLIPR.cjs → chunk-OXFC3DAM.cjs} +4 -4
- package/dist/chunk-PQJIJ4ZX.js +445 -0
- package/dist/{chunk-HY3AXLOI.cjs → chunk-PRXVSSIF.cjs} +13 -13
- package/dist/{chunk-TDV6EJHV.js → chunk-PRZOLCFW.js} +2 -2
- package/dist/{chunk-BVLN75LP.cjs → chunk-QL44NCZC.cjs} +1221 -1091
- package/dist/{chunk-VM6OVUUM.cjs → chunk-QN6PZLAP.cjs} +40 -40
- package/dist/{chunk-OV5TRZET.cjs → chunk-QXAQ3V7R.cjs} +27 -27
- package/dist/{chunk-NV5IRHI3.js → chunk-RBKVMHBH.js} +9 -9
- package/dist/{chunk-UPLVMVRX.cjs → chunk-RQCXRCYM.cjs} +2 -2
- package/dist/{chunk-WUQAOTHA.js → chunk-SERRQ736.js} +1 -1
- package/dist/{chunk-SS3K7OIM.cjs → chunk-SWSTGV4F.cjs} +81 -81
- package/dist/{chunk-RCE5SJBA.js → chunk-T47VP2ZT.js} +3 -3
- package/dist/{chunk-FLUF2GZH.js → chunk-WHMIWJL7.js} +1 -1
- package/dist/{chunk-JC6DLWTE.js → chunk-WQZ4AH2P.js} +1 -1
- package/dist/{chunk-D5FBNKQM.cjs → chunk-WXH3GMCF.cjs} +8 -8
- package/dist/chunk-XHPRD45G.cjs +32 -0
- package/dist/{chunk-THL5JDWJ.cjs → chunk-Y54WDY2O.cjs} +2 -2
- package/dist/{chunk-YRCKEGL2.js → chunk-YDMHG6BA.js} +1 -1
- package/dist/chunk-YHVA5NHI.js +2698 -0
- package/dist/{chunk-JXF23MPG.js → chunk-ZMIMKNSQ.js} +1 -1
- package/dist/cli.cjs +10 -10
- package/dist/cli.js +1 -1
- package/dist/email-queue-BJDH2ID7.cjs +29 -0
- package/dist/email-queue-MWP4R67H.js +8 -0
- package/dist/email-service-6JODEMUA.js +3 -0
- package/dist/email-service-VA4Q4ZRB.cjs +28 -0
- package/dist/emit-order-notification-trigger-X36V4DOH.cjs +16 -0
- package/dist/emit-order-notification-trigger-XKN2TWVF.js +3 -0
- package/dist/erp-config-enabled-32XTHBBT.cjs +11 -0
- package/dist/erp-config-enabled-CASE5YVI.js +2 -0
- package/dist/erp-order-invoice-5O42ZKC5.cjs +28 -0
- package/dist/erp-order-invoice-JEQKFXG4.js +7 -0
- package/dist/{event-order-defaults-DU7V3YND.cjs → event-order-defaults-TR45WAQQ.cjs} +10 -10
- package/dist/{event-order-defaults-H4RT7NMR.js → event-order-defaults-VXYO6NHT.js} +2 -2
- package/dist/generate-local-invoice-pdf-2NCA2WBL.cjs +12 -0
- package/dist/generate-local-invoice-pdf-XUH6GYEJ.js +3 -0
- package/dist/hooks.cjs +24 -24
- package/dist/hooks.js +2 -2
- package/dist/index.cjs +497 -494
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +39 -36
- package/dist/interpolate-KD37IRF2.js +2 -0
- package/dist/interpolate-WP6OSJHN.cjs +11 -0
- package/dist/invoice-templates-2ESQ7K4N.cjs +19 -0
- package/dist/invoice-templates-3AXTXERZ.js +2 -0
- package/dist/middleware.cjs +4 -4
- package/dist/middleware.js +2 -2
- package/dist/{order-assignees-handlers-L3RVKUBS.js → order-assignees-handlers-F7WOZHOG.js} +1 -1
- package/dist/{order-assignees-handlers-KF7RMTV5.cjs → order-assignees-handlers-JEJ5IDID.cjs} +3 -3
- package/dist/{order-completion-otp-handlers-HFGCPC4O.js → order-completion-otp-handlers-FIW7PZ6W.js} +12 -9
- package/dist/{order-completion-otp-handlers-DZAXK4GQ.cjs → order-completion-otp-handlers-LNAZTMTS.cjs} +25 -22
- package/dist/{order-inventory-76V4XIGW.js → order-inventory-R3AU6N4V.js} +2 -2
- package/dist/{order-inventory-2MYRKEPC.cjs → order-inventory-UUFPWLBW.cjs} +10 -10
- package/dist/order-notification-dispatcher-FS54ANAV.js +13 -0
- package/dist/order-notification-dispatcher-GG5C4LKZ.cjs +38 -0
- package/dist/paid-order-erp-GRXR2OG6.js +3 -0
- package/dist/paid-order-erp-X5QHPI23.cjs +12 -0
- package/dist/pg-boss-service-CMW3KQJM.js +2 -0
- package/dist/pg-boss-service-GA6ZVD5G.cjs +15 -0
- package/dist/{razorpay-U23LGY72.cjs → razorpay-GP2DXVP2.cjs} +2 -2
- package/dist/{razorpay-KLO2KNCB.js → razorpay-I3G5LNYH.js} +1 -1
- package/dist/{rbac-debug-db-KWV7D5PQ.cjs → rbac-debug-db-2ZI3XKA4.cjs} +4 -4
- package/dist/{rbac-debug-db-DFZWZ6GV.js → rbac-debug-db-IRKT6G62.js} +2 -2
- package/dist/resolve-invoice-asset-url-64QQUVC3.js +2 -0
- package/dist/resolve-invoice-asset-url-J7WAMD26.cjs +11 -0
- package/dist/retire-soft-deleted-unique-DZALT537.cjs +15 -0
- package/dist/{retire-soft-deleted-unique-NXQIH4BC.js → retire-soft-deleted-unique-F25KZBZK.js} +2 -2
- package/dist/sms-defaults-DSO3M26Y.js +2 -0
- package/dist/{sms-defaults-KCOPKQBA.cjs → sms-defaults-GDFILHHR.cjs} +5 -5
- package/dist/{sms-notification-templates-handlers-SJLO7JGZ.js → sms-notification-templates-handlers-ZGDCVS5Z.js} +1 -1
- package/dist/{sms-notification-templates-handlers-YSB3L2PK.cjs → sms-notification-templates-handlers-ZKLKFRFZ.cjs} +3 -3
- package/dist/{stripe-VU6OEG2D.cjs → stripe-2APRZHKU.cjs} +2 -2
- package/dist/{stripe-4FD27QVJ.js → stripe-7CO2ETTN.js} +1 -1
- package/dist/theme.cjs +10 -10
- package/dist/theme.js +3 -3
- package/dist/vendor-invite-status-45ZCWKCX.js +2 -0
- package/dist/{vendor-invite-status-77O7ZQ3U.cjs → vendor-invite-status-AT2E4FUA.cjs} +5 -5
- package/package.json +2 -1
- package/dist/chunk-GLD263KW.cjs +0 -862
- package/dist/chunk-OPJEV44S.js +0 -847
- package/dist/chunk-SHUYVCID.js +0 -4
- package/dist/chunk-USNT2KNT.cjs +0 -6
- package/dist/email-queue-4OY45JIU.cjs +0 -26
- package/dist/email-queue-HGXB2FIS.js +0 -5
- package/dist/email-service-5O24BSFR.cjs +0 -28
- package/dist/email-service-ADDF52PJ.js +0 -3
- package/dist/emit-order-notification-trigger-EJJZ6XTS.js +0 -3
- package/dist/emit-order-notification-trigger-ZD5YN3JM.cjs +0 -16
- package/dist/erp-config-enabled-CUMQ6N2V.cjs +0 -11
- package/dist/erp-config-enabled-T37X7T34.js +0 -2
- package/dist/erp-order-invoice-H6HCJ7YS.js +0 -4
- package/dist/erp-order-invoice-YUSPZ7CE.cjs +0 -25
- package/dist/interpolate-WAKPN56R.cjs +0 -11
- package/dist/interpolate-WDUWDF3I.js +0 -2
- package/dist/order-notification-dispatcher-ECPFI7CD.js +0 -10
- package/dist/order-notification-dispatcher-LL7ETKLU.cjs +0 -35
- package/dist/paid-order-erp-3USEG6WL.js +0 -3
- package/dist/paid-order-erp-FSQ3GSXE.cjs +0 -12
- package/dist/pg-boss-service-BDGOKM2T.cjs +0 -15
- package/dist/pg-boss-service-WCBJD4JB.js +0 -2
- package/dist/retire-soft-deleted-unique-5VXBA5XX.cjs +0 -15
- package/dist/sms-defaults-2NL24H57.js +0 -2
- package/dist/vendor-invite-status-PWJ3DE76.js +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkQXAQ3V7R_cjs = require('./chunk-QXAQ3V7R.cjs');
|
|
4
|
+
var chunkLXWF6T7F_cjs = require('./chunk-LXWF6T7F.cjs');
|
|
5
|
+
var chunk4WZNRVEZ_cjs = require('./chunk-4WZNRVEZ.cjs');
|
|
6
|
+
var chunkCTTV375J_cjs = require('./chunk-CTTV375J.cjs');
|
|
7
|
+
var chunkXHPRD45G_cjs = require('./chunk-XHPRD45G.cjs');
|
|
8
8
|
var _CredentialsProvider = require('next-auth/providers/credentials');
|
|
9
9
|
var _GoogleProvider = require('next-auth/providers/google');
|
|
10
10
|
|
|
@@ -15,12 +15,12 @@ var _GoogleProvider__default = /*#__PURE__*/_interopDefault(_GoogleProvider);
|
|
|
15
15
|
|
|
16
16
|
// src/auth/seed-permissions.ts
|
|
17
17
|
async function seedAdministratorPermissions(dataSource, entityMap) {
|
|
18
|
-
const entities =
|
|
18
|
+
const entities = chunkLXWF6T7F_cjs.getPermissionableEntityKeys(entityMap);
|
|
19
19
|
const groupRepo = dataSource.getRepository(entityMap.user_groups);
|
|
20
20
|
const permRepo = dataSource.getRepository(entityMap.permissions);
|
|
21
21
|
const adminGroup = await groupRepo.findOne({
|
|
22
22
|
where: {
|
|
23
|
-
name:
|
|
23
|
+
name: chunkLXWF6T7F_cjs.ADMIN_GROUP_NAME,
|
|
24
24
|
deleted: false
|
|
25
25
|
}
|
|
26
26
|
});
|
|
@@ -53,7 +53,7 @@ async function seedAdministratorPermissions(dataSource, entityMap) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
chunkXHPRD45G_cjs.__name(seedAdministratorPermissions, "seedAdministratorPermissions");
|
|
57
57
|
|
|
58
58
|
// src/auth/auth-providers-settings.ts
|
|
59
59
|
var AUTH_PROVIDERS_SETTINGS_GROUP = "auth_providers";
|
|
@@ -66,12 +66,12 @@ function parseEnabled(raw) {
|
|
|
66
66
|
}
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
chunkXHPRD45G_cjs.__name(parseEnabled, "parseEnabled");
|
|
70
70
|
function resolveSettingsEncryptionKey() {
|
|
71
71
|
if (typeof process === "undefined") return void 0;
|
|
72
72
|
return process.env.SETTINGS_ENCRYPTION_KEY?.trim() || process.env.NEXTAUTH_SECRET?.trim() || void 0;
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
chunkXHPRD45G_cjs.__name(resolveSettingsEncryptionKey, "resolveSettingsEncryptionKey");
|
|
75
75
|
function decryptSettingValue(encoded, key) {
|
|
76
76
|
const buf = Buffer.from(encoded, "base64");
|
|
77
77
|
const keyBuf = Buffer.from(key.padEnd(32, "0").slice(0, 32), "utf8");
|
|
@@ -79,7 +79,7 @@ function decryptSettingValue(encoded, key) {
|
|
|
79
79
|
for (let i = 0; i < buf.length; i++) out[i] = buf[i] ^ keyBuf[i % keyBuf.length];
|
|
80
80
|
return out.toString("utf8");
|
|
81
81
|
}
|
|
82
|
-
|
|
82
|
+
chunkXHPRD45G_cjs.__name(decryptSettingValue, "decryptSettingValue");
|
|
83
83
|
async function loadAuthProvidersSettingsFromDb(dataSource, entityMap, encryptionKey) {
|
|
84
84
|
if (!entityMap.configs) return {};
|
|
85
85
|
const key = encryptionKey ?? resolveSettingsEncryptionKey();
|
|
@@ -102,7 +102,7 @@ async function loadAuthProvidersSettingsFromDb(dataSource, entityMap, encryption
|
|
|
102
102
|
}
|
|
103
103
|
return out;
|
|
104
104
|
}
|
|
105
|
-
|
|
105
|
+
chunkXHPRD45G_cjs.__name(loadAuthProvidersSettingsFromDb, "loadAuthProvidersSettingsFromDb");
|
|
106
106
|
function fromSettingsMap(map) {
|
|
107
107
|
const clientId = String(map.googleClientId ?? map.GOOGLE_CLIENT_ID ?? "").trim();
|
|
108
108
|
const clientSecret = String(map.googleClientSecret ?? map.GOOGLE_CLIENT_SECRET ?? "").trim();
|
|
@@ -114,7 +114,7 @@ function fromSettingsMap(map) {
|
|
|
114
114
|
clientSecret
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
chunkXHPRD45G_cjs.__name(fromSettingsMap, "fromSettingsMap");
|
|
118
118
|
function fromEnv() {
|
|
119
119
|
const env = typeof process !== "undefined" ? process.env : void 0;
|
|
120
120
|
if (!env) return null;
|
|
@@ -129,12 +129,12 @@ function fromEnv() {
|
|
|
129
129
|
clientSecret
|
|
130
130
|
};
|
|
131
131
|
}
|
|
132
|
-
|
|
132
|
+
chunkXHPRD45G_cjs.__name(fromEnv, "fromEnv");
|
|
133
133
|
async function resolveGoogleAuthConfig(input = {}) {
|
|
134
134
|
if (input.settings) {
|
|
135
135
|
const fromExplicit = fromSettingsMap(input.settings);
|
|
136
136
|
if (fromExplicit?.enabled) {
|
|
137
|
-
|
|
137
|
+
chunkCTTV375J_cjs.logAuth("resolveGoogleAuthConfig: from explicit settings", {
|
|
138
138
|
enabled: true
|
|
139
139
|
});
|
|
140
140
|
return fromExplicit;
|
|
@@ -145,20 +145,20 @@ async function resolveGoogleAuthConfig(input = {}) {
|
|
|
145
145
|
const map = await loadAuthProvidersSettingsFromDb(input.dataSource, input.entityMap, input.encryptionKey);
|
|
146
146
|
const fromDb = fromSettingsMap(map);
|
|
147
147
|
if (fromDb?.enabled) {
|
|
148
|
-
|
|
148
|
+
chunkCTTV375J_cjs.logAuth("resolveGoogleAuthConfig: from DB settings", {
|
|
149
149
|
enabled: true
|
|
150
150
|
});
|
|
151
151
|
return fromDb;
|
|
152
152
|
}
|
|
153
153
|
if (map.googleEnabled !== void 0 || map.googleClientId !== void 0) {
|
|
154
|
-
|
|
154
|
+
chunkCTTV375J_cjs.logAuth("resolveGoogleAuthConfig: DB present but incomplete/disabled", {
|
|
155
155
|
googleEnabled: map.googleEnabled ?? null,
|
|
156
156
|
hasClientId: Boolean(String(map.googleClientId ?? "").trim()),
|
|
157
157
|
hasClientSecret: Boolean(String(map.googleClientSecret ?? "").trim())
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
} catch (err) {
|
|
161
|
-
|
|
161
|
+
chunkCTTV375J_cjs.logAuth("resolveGoogleAuthConfig: DB load failed", {
|
|
162
162
|
message: err instanceof Error ? err.message : String(err)
|
|
163
163
|
});
|
|
164
164
|
}
|
|
@@ -166,7 +166,7 @@ async function resolveGoogleAuthConfig(input = {}) {
|
|
|
166
166
|
if (!input.skipEnvFallback) {
|
|
167
167
|
const envCfg = fromEnv();
|
|
168
168
|
if (envCfg) {
|
|
169
|
-
|
|
169
|
+
chunkCTTV375J_cjs.logAuth("resolveGoogleAuthConfig: from env", {
|
|
170
170
|
enabled: true
|
|
171
171
|
});
|
|
172
172
|
return envCfg;
|
|
@@ -174,12 +174,12 @@ async function resolveGoogleAuthConfig(input = {}) {
|
|
|
174
174
|
}
|
|
175
175
|
return null;
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
chunkXHPRD45G_cjs.__name(resolveGoogleAuthConfig, "resolveGoogleAuthConfig");
|
|
178
178
|
function googleOAuthRedirectUri(baseUrl) {
|
|
179
179
|
const base = (baseUrl ?? process.env.NEXTAUTH_URL ?? "").replace(/\/$/, "");
|
|
180
180
|
return base ? `${base}/api/auth/callback/google` : "/api/auth/callback/google";
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
chunkXHPRD45G_cjs.__name(googleOAuthRedirectUri, "googleOAuthRedirectUri");
|
|
183
183
|
function isGoogleAuthPubliclyEnabled(settings) {
|
|
184
184
|
if (!settings) return false;
|
|
185
185
|
if (settings.googleEnabled !== void 0 && settings.googleEnabled !== "") {
|
|
@@ -187,17 +187,17 @@ function isGoogleAuthPubliclyEnabled(settings) {
|
|
|
187
187
|
}
|
|
188
188
|
return parseEnabled(settings.enabled);
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
chunkXHPRD45G_cjs.__name(isGoogleAuthPubliclyEnabled, "isGoogleAuthPubliclyEnabled");
|
|
191
191
|
|
|
192
192
|
// src/auth/create-google-customer.ts
|
|
193
193
|
function normalizeEmail(email) {
|
|
194
194
|
return email.trim().toLowerCase();
|
|
195
195
|
}
|
|
196
|
-
|
|
196
|
+
chunkXHPRD45G_cjs.__name(normalizeEmail, "normalizeEmail");
|
|
197
197
|
async function createCustomerUserFromGoogleOAuth(input) {
|
|
198
198
|
const email = normalizeEmail(input.email);
|
|
199
199
|
if (!email || !input.entityMap.users || !input.entityMap.user_groups) {
|
|
200
|
-
|
|
200
|
+
chunkCTTV375J_cjs.logAuth("createCustomerUserFromGoogleOAuth skipped", {
|
|
201
201
|
reason: "missing_email_or_entities",
|
|
202
202
|
hasUsers: Boolean(input.entityMap.users),
|
|
203
203
|
hasGroups: Boolean(input.entityMap.user_groups)
|
|
@@ -207,7 +207,7 @@ async function createCustomerUserFromGoogleOAuth(input) {
|
|
|
207
207
|
const userRepo = input.dataSource.getRepository(input.entityMap.users);
|
|
208
208
|
const groupRepo = input.dataSource.getRepository(input.entityMap.user_groups);
|
|
209
209
|
try {
|
|
210
|
-
await
|
|
210
|
+
await chunk4WZNRVEZ_cjs.retireSoftDeletedUniqueValue(userRepo, "email", email);
|
|
211
211
|
} catch {
|
|
212
212
|
}
|
|
213
213
|
const existing = await userRepo.findOne({
|
|
@@ -231,7 +231,7 @@ async function createCustomerUserFromGoogleOAuth(input) {
|
|
|
231
231
|
});
|
|
232
232
|
const groupId = customerG ? Number(customerG.id) : null;
|
|
233
233
|
if (!Number.isFinite(groupId) || groupId == null) {
|
|
234
|
-
|
|
234
|
+
chunkCTTV375J_cjs.logAuth("createCustomerUserFromGoogleOAuth failed", {
|
|
235
235
|
reason: "customer_group_missing",
|
|
236
236
|
email
|
|
237
237
|
});
|
|
@@ -252,7 +252,7 @@ async function createCustomerUserFromGoogleOAuth(input) {
|
|
|
252
252
|
}));
|
|
253
253
|
const userId = Number(created.id);
|
|
254
254
|
if (!Number.isFinite(userId)) {
|
|
255
|
-
|
|
255
|
+
chunkCTTV375J_cjs.logAuth("createCustomerUserFromGoogleOAuth failed", {
|
|
256
256
|
reason: "invalid_id",
|
|
257
257
|
email
|
|
258
258
|
});
|
|
@@ -260,13 +260,13 @@ async function createCustomerUserFromGoogleOAuth(input) {
|
|
|
260
260
|
}
|
|
261
261
|
if (input.entityMap.contacts) {
|
|
262
262
|
try {
|
|
263
|
-
await
|
|
263
|
+
await chunkQXAQ3V7R_cjs.linkUnclaimedContactToUser(input.dataSource, input.entityMap.contacts, userId, email);
|
|
264
264
|
} catch {
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
if (input.entityMap.customer) {
|
|
268
268
|
try {
|
|
269
|
-
await
|
|
269
|
+
await chunkQXAQ3V7R_cjs.ensureCustomerForUser(input.dataSource, input.entityMap.customer, {
|
|
270
270
|
id: userId,
|
|
271
271
|
name: displayName,
|
|
272
272
|
email,
|
|
@@ -287,14 +287,14 @@ async function createCustomerUserFromGoogleOAuth(input) {
|
|
|
287
287
|
]
|
|
288
288
|
});
|
|
289
289
|
if (!loaded) {
|
|
290
|
-
|
|
290
|
+
chunkCTTV375J_cjs.logAuth("createCustomerUserFromGoogleOAuth failed", {
|
|
291
291
|
reason: "reload_failed",
|
|
292
292
|
email,
|
|
293
293
|
userId
|
|
294
294
|
});
|
|
295
295
|
return null;
|
|
296
296
|
}
|
|
297
|
-
|
|
297
|
+
chunkCTTV375J_cjs.logAuth("createCustomerUserFromGoogleOAuth ok", {
|
|
298
298
|
email,
|
|
299
299
|
userId
|
|
300
300
|
});
|
|
@@ -311,20 +311,20 @@ async function createCustomerUserFromGoogleOAuth(input) {
|
|
|
311
311
|
]
|
|
312
312
|
});
|
|
313
313
|
if (raced) {
|
|
314
|
-
|
|
314
|
+
chunkCTTV375J_cjs.logAuth("createCustomerUserFromGoogleOAuth raced_to_existing", {
|
|
315
315
|
email,
|
|
316
316
|
userId: raced.id
|
|
317
317
|
});
|
|
318
318
|
return raced;
|
|
319
319
|
}
|
|
320
|
-
|
|
320
|
+
chunkCTTV375J_cjs.logAuth("createCustomerUserFromGoogleOAuth error", {
|
|
321
321
|
email,
|
|
322
322
|
message: err instanceof Error ? err.message : String(err)
|
|
323
323
|
});
|
|
324
324
|
return null;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
|
|
327
|
+
chunkXHPRD45G_cjs.__name(createCustomerUserFromGoogleOAuth, "createCustomerUserFromGoogleOAuth");
|
|
328
328
|
|
|
329
329
|
// src/auth/nextauth-options.ts
|
|
330
330
|
var CredentialsProvider = _CredentialsProvider__default.default.default ?? _CredentialsProvider__default.default;
|
|
@@ -354,12 +354,12 @@ function parseBooleanSetting(value) {
|
|
|
354
354
|
}
|
|
355
355
|
return null;
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
chunkXHPRD45G_cjs.__name(parseBooleanSetting, "parseBooleanSetting");
|
|
358
358
|
async function checkMultiVendorEnabledViaSettingsApi() {
|
|
359
359
|
const FAIL_OPEN_DEFAULT = true;
|
|
360
360
|
const base = process.env.NEXTAUTH_URL?.replace(/\/$/, "");
|
|
361
361
|
if (!base) {
|
|
362
|
-
|
|
362
|
+
chunkCTTV375J_cjs.logAuth("multiVendorCheck: no NEXTAUTH_URL, defaulting", {
|
|
363
363
|
multiVendorEnabled: FAIL_OPEN_DEFAULT
|
|
364
364
|
});
|
|
365
365
|
return FAIL_OPEN_DEFAULT;
|
|
@@ -369,7 +369,7 @@ async function checkMultiVendorEnabledViaSettingsApi() {
|
|
|
369
369
|
cache: "no-store"
|
|
370
370
|
});
|
|
371
371
|
if (!res.ok) {
|
|
372
|
-
|
|
372
|
+
chunkCTTV375J_cjs.logAuth("multiVendorCheck: non-OK response, defaulting", {
|
|
373
373
|
status: res.status
|
|
374
374
|
});
|
|
375
375
|
return FAIL_OPEN_DEFAULT;
|
|
@@ -378,27 +378,27 @@ async function checkMultiVendorEnabledViaSettingsApi() {
|
|
|
378
378
|
const parsed = parseBooleanSetting(data?.enabled ?? data?.value ?? data?.isEnabled ?? data?.active ?? data?.state);
|
|
379
379
|
return parsed ?? FAIL_OPEN_DEFAULT;
|
|
380
380
|
} catch (err) {
|
|
381
|
-
|
|
381
|
+
chunkCTTV375J_cjs.logAuth("multiVendorCheck: fetch failed, defaulting", {
|
|
382
382
|
message: err instanceof Error ? err.message : String(err)
|
|
383
383
|
});
|
|
384
384
|
return FAIL_OPEN_DEFAULT;
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
|
|
387
|
+
chunkXHPRD45G_cjs.__name(checkMultiVendorEnabledViaSettingsApi, "checkMultiVendorEnabledViaSettingsApi");
|
|
388
388
|
function sessionUserFromNextAuthUser(user) {
|
|
389
389
|
const g = user.group;
|
|
390
|
-
const isRBACAdmin =
|
|
390
|
+
const isRBACAdmin = chunkLXWF6T7F_cjs.isSuperAdmin({
|
|
391
391
|
groupId: user.groupId ?? void 0,
|
|
392
392
|
groupName: g?.name,
|
|
393
393
|
isRBACAdmin: false
|
|
394
394
|
});
|
|
395
|
-
const entityPerms =
|
|
395
|
+
const entityPerms = chunkLXWF6T7F_cjs.permissionRowsToRecord(g?.permissions);
|
|
396
396
|
const rawAdminAccess = user.adminAccess;
|
|
397
397
|
const adminAccess = rawAdminAccess === true ? true : rawAdminAccess === false ? false : void 0;
|
|
398
398
|
const vendorIds = user.vendorIds ?? [];
|
|
399
399
|
const vendorRole = user.vendorRole ?? null;
|
|
400
400
|
const isVendorRoleOwner = user.isVendorRoleOwner ?? false;
|
|
401
|
-
const { isVendorPortal, isVendorOwner: isVendorOwner2 } =
|
|
401
|
+
const { isVendorPortal, isVendorOwner: isVendorOwner2 } = chunkLXWF6T7F_cjs.vendorPortalFlagsFromUser({
|
|
402
402
|
email: user.email,
|
|
403
403
|
isRBACAdmin,
|
|
404
404
|
groupName: g?.name,
|
|
@@ -426,11 +426,11 @@ function sessionUserFromNextAuthUser(user) {
|
|
|
426
426
|
isVendorOwner: isVendorOwner2
|
|
427
427
|
};
|
|
428
428
|
}
|
|
429
|
-
|
|
429
|
+
chunkXHPRD45G_cjs.__name(sessionUserFromNextAuthUser, "sessionUserFromNextAuthUser");
|
|
430
430
|
function isCustomerGroupUser(user) {
|
|
431
431
|
return user.group?.name?.toLocaleLowerCase().trim() === "customer";
|
|
432
432
|
}
|
|
433
|
-
|
|
433
|
+
chunkXHPRD45G_cjs.__name(isCustomerGroupUser, "isCustomerGroupUser");
|
|
434
434
|
function callbackUrlTargetsAdmin(callbackUrl) {
|
|
435
435
|
const raw = callbackUrl.trim();
|
|
436
436
|
if (!raw) return false;
|
|
@@ -442,21 +442,21 @@ function callbackUrlTargetsAdmin(callbackUrl) {
|
|
|
442
442
|
return raw.includes("/admin");
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
|
|
445
|
+
chunkXHPRD45G_cjs.__name(callbackUrlTargetsAdmin, "callbackUrlTargetsAdmin");
|
|
446
446
|
function permitsCustomerLogin(allowCustomerLogin, credentials) {
|
|
447
447
|
if (allowCustomerLogin === true) return true;
|
|
448
448
|
if (allowCustomerLogin === false) return false;
|
|
449
449
|
const callbackUrl = typeof credentials?.callbackUrl === "string" ? credentials.callbackUrl : "";
|
|
450
450
|
return !callbackUrlTargetsAdmin(callbackUrl);
|
|
451
451
|
}
|
|
452
|
-
|
|
452
|
+
chunkXHPRD45G_cjs.__name(permitsCustomerLogin, "permitsCustomerLogin");
|
|
453
453
|
function applySessionUserToAuthUser(target, sessionUser) {
|
|
454
454
|
Object.assign(target, sessionUser);
|
|
455
455
|
}
|
|
456
|
-
|
|
456
|
+
chunkXHPRD45G_cjs.__name(applySessionUserToAuthUser, "applySessionUserToAuthUser");
|
|
457
457
|
function getNextAuthOptions(config) {
|
|
458
458
|
const { getUserByEmail, comparePassword, signInPage = "/admin/signin", secret, extend, enablePasswordLogin = true, enableOtpLogin = false, authorizeOtp, allowCustomerLogin, google, createCustomerUserFromGoogle } = config;
|
|
459
|
-
|
|
459
|
+
chunkCTTV375J_cjs.logAuth("getNextAuthOptions init", chunkCTTV375J_cjs.nextAuthCookieDebugInfo());
|
|
460
460
|
const providers = [];
|
|
461
461
|
if (enablePasswordLogin) {
|
|
462
462
|
providers.push(CredentialsProvider({
|
|
@@ -475,7 +475,7 @@ function getNextAuthOptions(config) {
|
|
|
475
475
|
const creds = credentials;
|
|
476
476
|
const email = creds?.email?.trim() ?? "";
|
|
477
477
|
if (!email || !creds?.password) {
|
|
478
|
-
|
|
478
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
479
479
|
reason: "missing_email_or_password"
|
|
480
480
|
});
|
|
481
481
|
return null;
|
|
@@ -483,14 +483,14 @@ function getNextAuthOptions(config) {
|
|
|
483
483
|
try {
|
|
484
484
|
const user = await getUserByEmail(email);
|
|
485
485
|
if (!user) {
|
|
486
|
-
|
|
486
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
487
487
|
reason: "user_not_found",
|
|
488
488
|
email
|
|
489
489
|
});
|
|
490
490
|
return null;
|
|
491
491
|
}
|
|
492
492
|
if (user.blocked) {
|
|
493
|
-
|
|
493
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
494
494
|
reason: "blocked",
|
|
495
495
|
email,
|
|
496
496
|
userId: user.id
|
|
@@ -498,7 +498,7 @@ function getNextAuthOptions(config) {
|
|
|
498
498
|
return null;
|
|
499
499
|
}
|
|
500
500
|
if (user.inviteStatus === "pending") {
|
|
501
|
-
|
|
501
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
502
502
|
reason: "invite_pending",
|
|
503
503
|
email,
|
|
504
504
|
userId: user.id
|
|
@@ -506,7 +506,7 @@ function getNextAuthOptions(config) {
|
|
|
506
506
|
return null;
|
|
507
507
|
}
|
|
508
508
|
if (user.deleted) {
|
|
509
|
-
|
|
509
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
510
510
|
reason: "deleted",
|
|
511
511
|
email,
|
|
512
512
|
userId: user.id
|
|
@@ -514,7 +514,7 @@ function getNextAuthOptions(config) {
|
|
|
514
514
|
return null;
|
|
515
515
|
}
|
|
516
516
|
if (!user.password) {
|
|
517
|
-
|
|
517
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
518
518
|
reason: "no_password",
|
|
519
519
|
email,
|
|
520
520
|
userId: user.id
|
|
@@ -523,7 +523,7 @@ function getNextAuthOptions(config) {
|
|
|
523
523
|
}
|
|
524
524
|
const valid = await comparePassword(creds.password, user.password);
|
|
525
525
|
if (!valid) {
|
|
526
|
-
|
|
526
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
527
527
|
reason: "invalid_password",
|
|
528
528
|
email,
|
|
529
529
|
userId: user.id
|
|
@@ -531,7 +531,7 @@ function getNextAuthOptions(config) {
|
|
|
531
531
|
return null;
|
|
532
532
|
}
|
|
533
533
|
if (isCustomerGroupUser(user) && !permitsCustomerLogin(allowCustomerLogin, creds)) {
|
|
534
|
-
|
|
534
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
535
535
|
reason: "customer_group",
|
|
536
536
|
email,
|
|
537
537
|
userId: user.id,
|
|
@@ -543,7 +543,7 @@ function getNextAuthOptions(config) {
|
|
|
543
543
|
if (sessionUser.isVendorPortal && !sessionUser.isRBACAdmin) {
|
|
544
544
|
const multiVendorEnabled = await checkMultiVendorEnabledViaSettingsApi();
|
|
545
545
|
if (!multiVendorEnabled) {
|
|
546
|
-
|
|
546
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) rejected", {
|
|
547
547
|
reason: "multi_vendor_disabled",
|
|
548
548
|
email,
|
|
549
549
|
userId: user.id
|
|
@@ -551,11 +551,11 @@ function getNextAuthOptions(config) {
|
|
|
551
551
|
return null;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
|
-
|
|
554
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) ok", chunkCTTV375J_cjs.summarizeSessionUserForLog(sessionUser));
|
|
555
555
|
return sessionUser;
|
|
556
556
|
} catch (err) {
|
|
557
557
|
console.error("[cms-auth] authorize error (credentials):", err instanceof Error ? err.message : err);
|
|
558
|
-
|
|
558
|
+
chunkCTTV375J_cjs.logAuth("authorize(credentials) error", {
|
|
559
559
|
email,
|
|
560
560
|
message: err instanceof Error ? err.message : String(err)
|
|
561
561
|
});
|
|
@@ -596,7 +596,7 @@ function getNextAuthOptions(config) {
|
|
|
596
596
|
});
|
|
597
597
|
if (!user || user.blocked || user.inviteStatus === "pending" || user.deleted) return null;
|
|
598
598
|
if (isCustomerGroupUser(user) && !permitsCustomerLogin(allowCustomerLogin, creds)) {
|
|
599
|
-
|
|
599
|
+
chunkCTTV375J_cjs.logAuth("authorize(otp) rejected", {
|
|
600
600
|
reason: "customer_group",
|
|
601
601
|
identifier,
|
|
602
602
|
callbackUrl: creds?.callbackUrl ?? null
|
|
@@ -617,7 +617,7 @@ function getNextAuthOptions(config) {
|
|
|
617
617
|
clientSecret: google.clientSecret,
|
|
618
618
|
allowDangerousEmailAccountLinking: true
|
|
619
619
|
}));
|
|
620
|
-
|
|
620
|
+
chunkCTTV375J_cjs.logAuth("getNextAuthOptions: GoogleProvider registered");
|
|
621
621
|
}
|
|
622
622
|
const options = {
|
|
623
623
|
secret: secret ?? process.env.NEXTAUTH_SECRET,
|
|
@@ -645,7 +645,7 @@ function getNextAuthOptions(config) {
|
|
|
645
645
|
const emailRaw = typeof user?.email === "string" && user.email || (profile && typeof profile.email === "string" ? profile.email : "");
|
|
646
646
|
const email = emailRaw.trim().toLowerCase();
|
|
647
647
|
if (!email) {
|
|
648
|
-
|
|
648
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) rejected", {
|
|
649
649
|
reason: "missing_email"
|
|
650
650
|
});
|
|
651
651
|
return false;
|
|
@@ -659,21 +659,21 @@ function getNextAuthOptions(config) {
|
|
|
659
659
|
name: profileName
|
|
660
660
|
});
|
|
661
661
|
if (dbUser) {
|
|
662
|
-
|
|
662
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) created customer", {
|
|
663
663
|
email,
|
|
664
664
|
userId: dbUser.id
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
668
|
if (!dbUser) {
|
|
669
|
-
|
|
669
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) rejected", {
|
|
670
670
|
reason: "user_not_found",
|
|
671
671
|
email
|
|
672
672
|
});
|
|
673
673
|
return false;
|
|
674
674
|
}
|
|
675
675
|
if (dbUser.blocked) {
|
|
676
|
-
|
|
676
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) rejected", {
|
|
677
677
|
reason: "blocked",
|
|
678
678
|
email,
|
|
679
679
|
userId: dbUser.id
|
|
@@ -681,7 +681,7 @@ function getNextAuthOptions(config) {
|
|
|
681
681
|
return false;
|
|
682
682
|
}
|
|
683
683
|
if (dbUser.inviteStatus === "pending") {
|
|
684
|
-
|
|
684
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) rejected", {
|
|
685
685
|
reason: "invite_pending",
|
|
686
686
|
email,
|
|
687
687
|
userId: dbUser.id
|
|
@@ -689,7 +689,7 @@ function getNextAuthOptions(config) {
|
|
|
689
689
|
return false;
|
|
690
690
|
}
|
|
691
691
|
if (dbUser.deleted) {
|
|
692
|
-
|
|
692
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) rejected", {
|
|
693
693
|
reason: "deleted",
|
|
694
694
|
email,
|
|
695
695
|
userId: dbUser.id
|
|
@@ -697,7 +697,7 @@ function getNextAuthOptions(config) {
|
|
|
697
697
|
return false;
|
|
698
698
|
}
|
|
699
699
|
if (isCustomerGroupUser(dbUser) && allowCustomerLogin !== true) {
|
|
700
|
-
|
|
700
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) rejected", {
|
|
701
701
|
reason: "customer_group",
|
|
702
702
|
email,
|
|
703
703
|
userId: dbUser.id
|
|
@@ -708,7 +708,7 @@ function getNextAuthOptions(config) {
|
|
|
708
708
|
if (sessionUser.isVendorPortal && !sessionUser.isRBACAdmin) {
|
|
709
709
|
const multiVendorEnabled = await checkMultiVendorEnabledViaSettingsApi();
|
|
710
710
|
if (!multiVendorEnabled) {
|
|
711
|
-
|
|
711
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) rejected", {
|
|
712
712
|
reason: "multi_vendor_disabled",
|
|
713
713
|
email,
|
|
714
714
|
userId: dbUser.id
|
|
@@ -717,11 +717,11 @@ function getNextAuthOptions(config) {
|
|
|
717
717
|
}
|
|
718
718
|
}
|
|
719
719
|
applySessionUserToAuthUser(user, sessionUser);
|
|
720
|
-
|
|
720
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) ok", chunkCTTV375J_cjs.summarizeSessionUserForLog(sessionUser));
|
|
721
721
|
return true;
|
|
722
722
|
} catch (err) {
|
|
723
723
|
console.error("[cms-auth] signIn error (google):", err instanceof Error ? err.message : err);
|
|
724
|
-
|
|
724
|
+
chunkCTTV375J_cjs.logAuth("signIn(google) error", {
|
|
725
725
|
email,
|
|
726
726
|
message: err instanceof Error ? err.message : String(err)
|
|
727
727
|
});
|
|
@@ -730,9 +730,9 @@ function getNextAuthOptions(config) {
|
|
|
730
730
|
},
|
|
731
731
|
async jwt({ token, user, trigger, session }) {
|
|
732
732
|
if (user) {
|
|
733
|
-
|
|
733
|
+
chunkCTTV375J_cjs.logAuth("jwt callback: new sign-in", {
|
|
734
734
|
trigger,
|
|
735
|
-
user:
|
|
735
|
+
user: chunkCTTV375J_cjs.summarizeSessionUserForLog(user)
|
|
736
736
|
});
|
|
737
737
|
const u = user;
|
|
738
738
|
token.id = u.id;
|
|
@@ -752,7 +752,7 @@ function getNextAuthOptions(config) {
|
|
|
752
752
|
token.isVendorOwner = u.isVendorOwner;
|
|
753
753
|
}
|
|
754
754
|
if (trigger === "update" && session && typeof session === "object") {
|
|
755
|
-
|
|
755
|
+
chunkCTTV375J_cjs.logAuth("jwt callback: session update", {
|
|
756
756
|
trigger
|
|
757
757
|
});
|
|
758
758
|
const s = session;
|
|
@@ -765,10 +765,10 @@ function getNextAuthOptions(config) {
|
|
|
765
765
|
},
|
|
766
766
|
async session({ session, token }) {
|
|
767
767
|
const t = token;
|
|
768
|
-
|
|
768
|
+
chunkCTTV375J_cjs.logAuth("session callback", {
|
|
769
769
|
tokenHasId: t.id != null,
|
|
770
770
|
tokenEmail: typeof t.email === "string" ? t.email : null,
|
|
771
|
-
sessionUser:
|
|
771
|
+
sessionUser: chunkCTTV375J_cjs.summarizeSessionUserForLog(session.user)
|
|
772
772
|
});
|
|
773
773
|
if (session.user) {
|
|
774
774
|
if (typeof t.name === "string") session.user.name = t.name;
|
|
@@ -795,7 +795,7 @@ function getNextAuthOptions(config) {
|
|
|
795
795
|
};
|
|
796
796
|
return extend ? extend(options) : options;
|
|
797
797
|
}
|
|
798
|
-
|
|
798
|
+
chunkXHPRD45G_cjs.__name(getNextAuthOptions, "getNextAuthOptions");
|
|
799
799
|
async function buildNextAuthOptions(config) {
|
|
800
800
|
const { dataSource, entityMap, settingsEncryptionKey, googleResolve, google, createCustomerUserFromGoogle, ...rest } = config;
|
|
801
801
|
const resolved = google ?? await resolveGoogleAuthConfig({
|
|
@@ -806,7 +806,7 @@ async function buildNextAuthOptions(config) {
|
|
|
806
806
|
});
|
|
807
807
|
let createCustomer = createCustomerUserFromGoogle;
|
|
808
808
|
if (!createCustomer && rest.allowCustomerLogin === true && dataSource && entityMap && entityMap.users && entityMap.user_groups) {
|
|
809
|
-
createCustomer = /* @__PURE__ */
|
|
809
|
+
createCustomer = /* @__PURE__ */ chunkXHPRD45G_cjs.__name((input) => createCustomerUserFromGoogleOAuth({
|
|
810
810
|
dataSource,
|
|
811
811
|
entityMap,
|
|
812
812
|
email: input.email,
|
|
@@ -819,21 +819,21 @@ async function buildNextAuthOptions(config) {
|
|
|
819
819
|
createCustomerUserFromGoogle: createCustomer
|
|
820
820
|
});
|
|
821
821
|
}
|
|
822
|
-
|
|
822
|
+
chunkXHPRD45G_cjs.__name(buildNextAuthOptions, "buildNextAuthOptions");
|
|
823
823
|
function getStorefrontNextAuthOptions(config) {
|
|
824
824
|
return getNextAuthOptions({
|
|
825
825
|
...config,
|
|
826
826
|
allowCustomerLogin: true
|
|
827
827
|
});
|
|
828
828
|
}
|
|
829
|
-
|
|
829
|
+
chunkXHPRD45G_cjs.__name(getStorefrontNextAuthOptions, "getStorefrontNextAuthOptions");
|
|
830
830
|
async function buildStorefrontNextAuthOptions(config) {
|
|
831
831
|
return buildNextAuthOptions({
|
|
832
832
|
...config,
|
|
833
833
|
allowCustomerLogin: true
|
|
834
834
|
});
|
|
835
835
|
}
|
|
836
|
-
|
|
836
|
+
chunkXHPRD45G_cjs.__name(buildStorefrontNextAuthOptions, "buildStorefrontNextAuthOptions");
|
|
837
837
|
|
|
838
838
|
exports.AUTH_PROVIDERS_SETTINGS_GROUP = AUTH_PROVIDERS_SETTINGS_GROUP;
|
|
839
839
|
exports.buildNextAuthOptions = buildNextAuthOptions;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { notifyLog, notificationTriggerEmitter, maskNotifyPhone } from './chunk-
|
|
2
|
-
import { __name } from './chunk-
|
|
1
|
+
import { notifyLog, notificationTriggerEmitter, maskNotifyPhone } from './chunk-WHMIWJL7.js';
|
|
2
|
+
import { __name } from './chunk-5BKT4CS5.js';
|
|
3
3
|
|
|
4
4
|
// src/lib/emit-order-notification-trigger.ts
|
|
5
5
|
async function emitOrderNotificationTrigger(triggerKey, orderId, deps, extra) {
|
|
@@ -94,7 +94,7 @@ async function emitOrderNotificationTrigger(triggerKey, orderId, deps, extra) {
|
|
|
94
94
|
orderId
|
|
95
95
|
});
|
|
96
96
|
try {
|
|
97
|
-
const { dispatchOrderNotificationDirectly } = await import('./order-notification-dispatcher-
|
|
97
|
+
const { dispatchOrderNotificationDirectly } = await import('./order-notification-dispatcher-FS54ANAV.js');
|
|
98
98
|
await dispatchOrderNotificationDirectly(triggerKey, triggerPayload, deps.dataSource, deps.entityMap);
|
|
99
99
|
} catch (err) {
|
|
100
100
|
notifyLog.error("TRIGGER", "direct dispatch failed", {
|