@helloleo/plugins 0.2.2 → 0.2.3
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/index.js
CHANGED
|
@@ -25013,9 +25013,10 @@ function buildAuth() {
|
|
|
25013
25013
|
${envFields}
|
|
25014
25014
|
}
|
|
25015
25015
|
|
|
25016
|
+
// HELLOLEO_URL is injected by the platform as a bare host, no scheme.
|
|
25016
25017
|
return betterAuth({
|
|
25017
25018
|
secret: e.BETTER_AUTH_SECRET,
|
|
25018
|
-
baseURL: e.HELLOLEO_URL
|
|
25019
|
+
baseURL: e.HELLOLEO_URL ? \`https://\${e.HELLOLEO_URL}\` : 'http://localhost:3000',
|
|
25019
25020
|
database: drizzleAdapter(db, { provider: 'sqlite', schema }),
|
|
25020
25021
|
emailAndPassword: {
|
|
25021
25022
|
enabled: ${hasPassword},
|
|
@@ -25581,9 +25582,10 @@ function stripTrailingSlash(s: string) {
|
|
|
25581
25582
|
export function appOrigin(request: Request) {
|
|
25582
25583
|
// 1) Explicit override wins (set by the platform per environment).
|
|
25583
25584
|
if (nsEnv.PUBLIC_APP_URL) return stripTrailingSlash(nsEnv.PUBLIC_APP_URL)
|
|
25584
|
-
// 2) HELLOLEO_URL is injected on every deploy (the app's canonical origin
|
|
25585
|
-
// it's set even when the NetSuite
|
|
25586
|
-
|
|
25585
|
+
// 2) HELLOLEO_URL is injected on every deploy (the app's canonical origin,
|
|
25586
|
+
// a bare host with no scheme), so it's set even when the NetSuite
|
|
25587
|
+
// wizard's PUBLIC_APP_URL pin wasn't.
|
|
25588
|
+
if (nsEnv.HELLOLEO_URL) return \`https://\${stripTrailingSlash(nsEnv.HELLOLEO_URL)}\`
|
|
25587
25589
|
// 3) Preview/prod proxies rewrite Host, so trust the forwarded/original host
|
|
25588
25590
|
// they set (HelloLeo's nginx sends X-Original-Host) \u2014 that's the public URL
|
|
25589
25591
|
// the browser loaded, not an internal upstream host.
|
package/package.json
CHANGED
|
@@ -70,9 +70,10 @@ function buildAuth() {
|
|
|
70
70
|
${envFields}
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
// HELLOLEO_URL is injected by the platform as a bare host, no scheme.
|
|
73
74
|
return betterAuth({
|
|
74
75
|
secret: e.BETTER_AUTH_SECRET,
|
|
75
|
-
baseURL: e.HELLOLEO_URL
|
|
76
|
+
baseURL: e.HELLOLEO_URL ? \`https://\${e.HELLOLEO_URL}\` : 'http://localhost:3000',
|
|
76
77
|
database: drizzleAdapter(db, { provider: 'sqlite', schema }),
|
|
77
78
|
emailAndPassword: {
|
|
78
79
|
enabled: ${hasPassword},
|
|
@@ -142,9 +142,10 @@ function stripTrailingSlash(s: string) {
|
|
|
142
142
|
export function appOrigin(request: Request) {
|
|
143
143
|
// 1) Explicit override wins (set by the platform per environment).
|
|
144
144
|
if (nsEnv.PUBLIC_APP_URL) return stripTrailingSlash(nsEnv.PUBLIC_APP_URL)
|
|
145
|
-
// 2) HELLOLEO_URL is injected on every deploy (the app's canonical origin
|
|
146
|
-
// it's set even when the NetSuite
|
|
147
|
-
|
|
145
|
+
// 2) HELLOLEO_URL is injected on every deploy (the app's canonical origin,
|
|
146
|
+
// a bare host with no scheme), so it's set even when the NetSuite
|
|
147
|
+
// wizard's PUBLIC_APP_URL pin wasn't.
|
|
148
|
+
if (nsEnv.HELLOLEO_URL) return \`https://\${stripTrailingSlash(nsEnv.HELLOLEO_URL)}\`
|
|
148
149
|
// 3) Preview/prod proxies rewrite Host, so trust the forwarded/original host
|
|
149
150
|
// they set (HelloLeo's nginx sends X-Original-Host) — that's the public URL
|
|
150
151
|
// the browser loaded, not an internal upstream host.
|