nitro-web 0.2.8 → 0.2.10
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.
|
@@ -13,6 +13,7 @@ import { isArray, pick, ucFirst, fullNameSplit, isEmail } from 'nitro-web/util'
|
|
|
13
13
|
|
|
14
14
|
const JWT_SECRET = process.env.JWT_SECRET || 'replace_this_with_secure_env_secret'
|
|
15
15
|
let authConfig = null
|
|
16
|
+
const resolveBaseUrlWarned = new Set()
|
|
16
17
|
const requiredConfigKeys = [...requiredEmailConfigKeys]
|
|
17
18
|
const optionalConfigKeys = [...optionalEmailConfigKeys, 'masterPassword', 'isNotMultiTenant', 'autoAddExistingUsers', 'limitOneTenantPerUser']
|
|
18
19
|
|
|
@@ -740,12 +741,22 @@ export function resolveBaseUrl(reqUrl, cfgUrl) {
|
|
|
740
741
|
const cfgHost = new URL(cfgUrl).hostname
|
|
741
742
|
const reqApex = getDomain(reqHost)
|
|
742
743
|
const cfgApex = getDomain(cfgHost)
|
|
744
|
+
const errorMessage = 'Nitro warning: auth.resolveBaseUrl: The request origin and the config baseUrl ' +
|
|
745
|
+
'are not the same apex domain. Defaulting to the Cfg baseUrl. Req:'
|
|
743
746
|
|
|
744
747
|
if (reqApex && cfgApex) {
|
|
748
|
+
if (reqApex !== cfgApex && !resolveBaseUrlWarned.has(reqHost)) {
|
|
749
|
+
resolveBaseUrlWarned.add(reqHost)
|
|
750
|
+
console.warn(errorMessage, reqApex, '!=', cfgApex)
|
|
751
|
+
}
|
|
745
752
|
return reqApex === cfgApex ? reqUrl : cfgUrl
|
|
746
753
|
} else if (reqHost === cfgHost || reqHost.endsWith('.' + cfgHost)) {
|
|
747
754
|
return reqUrl
|
|
748
755
|
} else {
|
|
756
|
+
if (!resolveBaseUrlWarned.has(reqHost)) {
|
|
757
|
+
resolveBaseUrlWarned.add(reqHost)
|
|
758
|
+
console.warn(errorMessage, reqHost, '!=', cfgHost)
|
|
759
|
+
}
|
|
749
760
|
return cfgUrl
|
|
750
761
|
}
|
|
751
762
|
} catch (_) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"repository": "github:boycce/nitro-web",
|
|
5
5
|
"homepage": "https://boycce.github.io/nitro-web/",
|
|
6
6
|
"description": "Nitro is a battle-tested, modular base project to turbocharge your projects, styled using Tailwind 🚀",
|
package/server/email/index.js
CHANGED
|
@@ -91,11 +91,11 @@ export async function sendEmail({
|
|
|
91
91
|
for (let toNameEmail of toSplit) {
|
|
92
92
|
const [toName, toEmail] = getNameEmail(toNameEmail)
|
|
93
93
|
recipientVariables[toEmail] = {
|
|
94
|
-
...(data || {}),
|
|
95
94
|
configName: ucFirst(config.name),
|
|
96
95
|
domain: config.baseUrl,
|
|
97
96
|
replyToEmail: getNameEmail(replyTo)[1],
|
|
98
97
|
replyToName: getNameEmail(replyTo)[0],
|
|
98
|
+
...(data || {}),
|
|
99
99
|
email: toEmail,
|
|
100
100
|
greet: toName ? 'Hi ' + toName : 'Hello',
|
|
101
101
|
name: toName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.api.d.ts","sourceRoot":"","sources":["../../../components/auth/auth.api.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"auth.api.d.ts","sourceRoot":"","sources":["../../../components/auth/auth.api.js"],"names":[],"mappings":"AAqLA,qEAUC;AAED,qEAwEC;AAED,qEAGC;AAED,gEAMC;AAED,iEAgBC;AAED,oEAGC;AAED,oEA8BC;AAED,gEAgCC;AAID,qGAkDC;AAED;;;GAOC;AAED;;GAKC;AAID;;;;;;;;;GASG;AACH,8EAPG;IAA0B,QAAQ,GAA1B,MAAM;IACY,SAAS,GAA3B,MAAM;IACY,OAAO,GAAzB,MAAM;CACd,YAAQ,MAAM,+BACN,OAAO,GACL,OAAO,CAAC,MAAM,CAAC,CAqE3B;AAED,kFAiBC;AAED,mEAOC;AAED,+EAWC;AAED,sHAiBC;AAED;;;GAEC;AAED;;;GA0BC;AAED;;;;;;;;;GAmCC;AAED;;;;;;;;;;;;;;GAcG;AACH,mGAZG;IAAsD,IAAI,EAAlD,OAAO,GAAG,QAAQ,GAAG,eAAe;IACpB,EAAE,EAAlB,MAAM;IAKH,OAAO,EAJV;QACN,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QACtB,CAAK,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB;IAC0B,YAAY;IACZ,eAAe;IACjB,OAAO,GAAxB,MAAM;CACd,GAAU,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CAAC,CAAC,CAmEtE;AAED,0CAEC;AAED,8DA6BC;AAED,gFAKC;;;;;;;;;;;;;;;;;;;;AAzuBD;;;;;;;;;;;;;;;EAiBC;AA0ED,0DAEC;AAgCD,mDAEC;AAtBD,iDAkBC;AA5BD,2DAQC;AA0BD,2DAwBC;AAtID,0EAsEC"}
|