nitro-web 0.2.11 → 0.2.12
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.
|
@@ -739,8 +739,9 @@ export function resolveBaseUrl(reqUrl, cfgUrl) {
|
|
|
739
739
|
try {
|
|
740
740
|
const reqHost = new URL(reqUrl).hostname
|
|
741
741
|
const cfgHost = new URL(cfgUrl).hostname
|
|
742
|
-
|
|
743
|
-
const
|
|
742
|
+
// tldts treats "localhost" as an unknown suffix, so we add an override
|
|
743
|
+
const reqApex = /(^|\.)localhost$/.test(reqHost) ? 'localhost' : getDomain(reqHost)
|
|
744
|
+
const cfgApex = /(^|\.)localhost$/.test(cfgHost) ? 'localhost' : getDomain(cfgHost)
|
|
744
745
|
const errorMessage = 'Nitro warning: auth.resolveBaseUrl: The request origin and the config baseUrl ' +
|
|
745
746
|
'are not the same apex domain. Defaulting to the Cfg baseUrl. Req:'
|
|
746
747
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
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 🚀",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"minor": "npm run types && standard-version -a --release-as minor && npm publish && cd ../webpack && npm publish",
|
|
32
32
|
"patch": "npm run types && standard-version -a --release-as patch && npm publish && cd ../webpack && npm publish",
|
|
33
33
|
"republish": "npm publish && cd ../webpack && npm publish",
|
|
34
|
-
"test": "node --test
|
|
34
|
+
"test": "node --test tests/",
|
|
35
35
|
"types": "tsc util.js ./server/index.js --declaration --declarationMap --allowJs --emitDeclarationOnly --jsx react-jsx --esModuleInterop --skipLibCheck --outDir types && cd ../webpack && npm run types -w . && cd ../core"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
package/server/email/index.js
CHANGED
|
@@ -26,8 +26,8 @@ export const optionalEmailConfigKeys = ['emailReplyTo', 'emailTestMode', 'mailgu
|
|
|
26
26
|
* @param {string} opts.to - Recipient(s), e.g. "Bruce<bruce@wayneenterprises.com>,..."
|
|
27
27
|
* @param {Config} opts.config - Config object
|
|
28
28
|
* @param {string} [opts.bcc] - BCC, e.g. "Bruce<bruce@wayneenterprises.com>" (not sent in development)
|
|
29
|
-
* @param {object} [opts.data] - template data shared across recipients
|
|
30
|
-
* @param {object} [opts.swigData] - vars for Nunjucks/Swig render only (not sent to Mailgun)
|
|
29
|
+
* @param {object} [opts.data] - common template data shared across recipients
|
|
30
|
+
* @param {object} [opts.swigData] - vars for Nunjucks/Swig render only (not sent to Mailgun). Inherits data.
|
|
31
31
|
* @param {string} [opts.from] - sender address, e.g. "Bruce<bruce@wayneenterprises.com>"
|
|
32
32
|
* @param {string} [opts.replyTo] - reply-to address, e.g. "Bruce<bruce@wayneenterprises.com>"
|
|
33
33
|
* @param {object} [opts.recipientVariables] - Mailgun recipient-variables for batch sending
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { test } from 'node:test'
|
|
2
2
|
import assert from 'node:assert/strict'
|
|
3
|
-
import { resolveBaseUrl } from '
|
|
3
|
+
import { resolveBaseUrl } from '../components/auth/auth.api.js'
|
|
4
4
|
|
|
5
5
|
const cases = [
|
|
6
6
|
// [cfgUrl, reqUrl, expected, description]
|
|
@@ -16,6 +16,7 @@ const cases = [
|
|
|
16
16
|
|
|
17
17
|
['http://localhost:3000', 'http://localhost:3001', 'http://localhost:3001', 'match: localhost: port (ignored)'],
|
|
18
18
|
['http://localhost:3000', 'http://app.localhost:3001', 'http://app.localhost:3001', 'match: localhost: nested'],
|
|
19
|
+
['http://app.localhost:3000', 'http://app2.localhost:3001', 'http://app2.localhost:3001', 'match: localhost: sibling'],
|
|
19
20
|
['http://127.0.0.1:3000', 'http://127.0.0.1:3000', 'http://127.0.0.1:3000', 'match: IP exact'],
|
|
20
21
|
|
|
21
22
|
// cfg: mismatch
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,8DA8BC;AAED,gFAKC;;;;;;;;;;;;;;;;;;;;AA1uBD;;;;;;;;;;;;;;;EAiBC;AA0ED,0DAEC;AAgCD,mDAEC;AAtBD,iDAkBC;AA5BD,2DAQC;AA0BD,2DAwBC;AAtID,0EAsEC"}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* @param {string} opts.to - Recipient(s), e.g. "Bruce<bruce@wayneenterprises.com>,..."
|
|
8
8
|
* @param {Config} opts.config - Config object
|
|
9
9
|
* @param {string} [opts.bcc] - BCC, e.g. "Bruce<bruce@wayneenterprises.com>" (not sent in development)
|
|
10
|
-
* @param {object} [opts.data] - template data shared across recipients
|
|
11
|
-
* @param {object} [opts.swigData] - vars for Nunjucks/Swig render only (not sent to Mailgun)
|
|
10
|
+
* @param {object} [opts.data] - common template data shared across recipients
|
|
11
|
+
* @param {object} [opts.swigData] - vars for Nunjucks/Swig render only (not sent to Mailgun). Inherits data.
|
|
12
12
|
* @param {string} [opts.from] - sender address, e.g. "Bruce<bruce@wayneenterprises.com>"
|
|
13
13
|
* @param {string} [opts.replyTo] - reply-to address, e.g. "Bruce<bruce@wayneenterprises.com>"
|
|
14
14
|
* @param {object} [opts.recipientVariables] - Mailgun recipient-variables for batch sending
|