@helloleo/plugins 0.2.2 → 0.2.4

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
@@ -24989,7 +24989,7 @@ ${oauth.map((p) => {
24989
24989
  const requireEnvFn = oauth.length ? `
24990
24990
  function requireEnv(value: string | undefined, name: string): string {
24991
24991
  if (!value) {
24992
- throw new Error(\`\${name} is not set. Add it to .env (dev) or run \\\`wrangler secret put \${name}\\\` (prod).\`)
24992
+ throw new Error(\`\${name} is not set. Add it to .env.\`)
24993
24993
  }
24994
24994
  return value
24995
24995
  }
@@ -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 || 'http://localhost:3000',
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), so
25585
- // it's set even when the NetSuite wizard's PUBLIC_APP_URL pin wasn't.
25586
- if (nsEnv.HELLOLEO_URL) return stripTrailingSlash(nsEnv.HELLOLEO_URL)
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helloleo/plugins",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "OpenCode plugins for HelloLeo",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -44,7 +44,7 @@ ${oauth
44
44
  ? `
45
45
  function requireEnv(value: string | undefined, name: string): string {
46
46
  if (!value) {
47
- throw new Error(\`\${name} is not set. Add it to .env (dev) or run \\\`wrangler secret put \${name}\\\` (prod).\`)
47
+ throw new Error(\`\${name} is not set. Add it to .env.\`)
48
48
  }
49
49
  return value
50
50
  }
@@ -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 || 'http://localhost:3000',
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), so
146
- // it's set even when the NetSuite wizard's PUBLIC_APP_URL pin wasn't.
147
- if (nsEnv.HELLOLEO_URL) return stripTrailingSlash(nsEnv.HELLOLEO_URL)
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.