@flaredev/cli 0.9.0 → 0.10.0
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 +241 -37
- package/package.json +2 -2
- package/templates/app/components/dashboard/dashboard-sidebar.tsx +8 -8
- package/templates/app/lib/auth.ts +177 -154
- package/templates/app/lib/resource/store.ts +63 -8
- package/templates/locks/package-lock.json +73 -73
- package/templates/locks/pnpm-lock.yaml +99 -99
- package/templates/locks/yarn.lock +74 -74
- package/templates/next/lib/auth.ts +25 -2
|
@@ -85,41 +85,41 @@
|
|
|
85
85
|
integrity sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==
|
|
86
86
|
|
|
87
87
|
"@cloudflare/vite-plugin@^1.54.10":
|
|
88
|
-
version "1.62.
|
|
89
|
-
resolved "https://registry.yarnpkg.com/@cloudflare/vite-plugin/-/vite-plugin-1.62.
|
|
90
|
-
integrity sha512-
|
|
88
|
+
version "1.62.5"
|
|
89
|
+
resolved "https://registry.yarnpkg.com/@cloudflare/vite-plugin/-/vite-plugin-1.62.5.tgz#5df3631a7871693a27ec526a261135e3f397f1dd"
|
|
90
|
+
integrity sha512-qJJonL8EvKuSPfrwSMiDEPp+klxTU08pan1bgm/jc3LrYe9Hp4XUkIGAcQdgv7P9OZbe6AU+51iMUtQOt85J2w==
|
|
91
91
|
dependencies:
|
|
92
92
|
"@cloudflare/unenv-preset" "2.16.2"
|
|
93
|
-
miniflare "5.
|
|
93
|
+
miniflare "5.20261001.0-alpha"
|
|
94
94
|
unenv "2.0.0-rc.24"
|
|
95
|
-
workerd "1.
|
|
96
|
-
wrangler "4.
|
|
95
|
+
workerd "1.20261001.1"
|
|
96
|
+
wrangler "4.147.0"
|
|
97
97
|
ws "8.21.0"
|
|
98
98
|
|
|
99
|
-
"@cloudflare/workerd-darwin-64@1.
|
|
100
|
-
version "1.
|
|
101
|
-
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.
|
|
102
|
-
integrity sha512-
|
|
99
|
+
"@cloudflare/workerd-darwin-64@1.20261001.1":
|
|
100
|
+
version "1.20261001.1"
|
|
101
|
+
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261001.1.tgz#fc328bd465e6471fc49ef03ff8d810b0266ac6f8"
|
|
102
|
+
integrity sha512-4cgSgDf28JSw/P5Dj5GCS59hzVqS5XnmGAWNkvYHLI6ODU9idGaMMNEuhJXDkEG/lsABmlVlnCgsdh2VbKWepw==
|
|
103
103
|
|
|
104
|
-
"@cloudflare/workerd-darwin-arm64@1.
|
|
105
|
-
version "1.
|
|
106
|
-
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.
|
|
107
|
-
integrity sha512-
|
|
104
|
+
"@cloudflare/workerd-darwin-arm64@1.20261001.1":
|
|
105
|
+
version "1.20261001.1"
|
|
106
|
+
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261001.1.tgz#525ff507f3aace710b4c1efe4295976d2aaade58"
|
|
107
|
+
integrity sha512-8ulAWruEVouNmEIsQsy9WSSCS9zkLu93W2MTwp5esiFyoPp05BNSVFIFsYSPi1pkFmBBd7fsnwMpbLkaJLaVPQ==
|
|
108
108
|
|
|
109
|
-
"@cloudflare/workerd-linux-64@1.
|
|
110
|
-
version "1.
|
|
111
|
-
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.
|
|
112
|
-
integrity sha512-
|
|
109
|
+
"@cloudflare/workerd-linux-64@1.20261001.1":
|
|
110
|
+
version "1.20261001.1"
|
|
111
|
+
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261001.1.tgz#d008b5b5bea26e265a33a5e7dfbb827fa0ff6fad"
|
|
112
|
+
integrity sha512-kZbTZJGrhsMOdqZ2BIybjaBRLZjYsRLWj7mcNw/6Y3hodOhp5MrNzcz4iWGwNVWwyIV+7Pl+/LX5VcgnRqdHOg==
|
|
113
113
|
|
|
114
|
-
"@cloudflare/workerd-linux-arm64@1.
|
|
115
|
-
version "1.
|
|
116
|
-
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.
|
|
117
|
-
integrity sha512-
|
|
114
|
+
"@cloudflare/workerd-linux-arm64@1.20261001.1":
|
|
115
|
+
version "1.20261001.1"
|
|
116
|
+
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261001.1.tgz#99cd88c3a8a975f553e6b9997569c6c676c5e378"
|
|
117
|
+
integrity sha512-oOk3Zj6k/8oP0FJgZBWDn7+BqbsqIMEMaV95pulHPVbwVu4wYoLfQq2hp0vkbCNsCFLqZb7cqixXdrwD54ZIow==
|
|
118
118
|
|
|
119
|
-
"@cloudflare/workerd-windows-64@1.
|
|
120
|
-
version "1.
|
|
121
|
-
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.
|
|
122
|
-
integrity sha512-
|
|
119
|
+
"@cloudflare/workerd-windows-64@1.20261001.1":
|
|
120
|
+
version "1.20261001.1"
|
|
121
|
+
resolved "https://registry.yarnpkg.com/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261001.1.tgz#38a15cfb12e9b8bd614ad80c5332f28ecfaa969b"
|
|
122
|
+
integrity sha512-uRxm5W4VyBkoSaoP1BfOuH0873tE+vxsknF4sab6/5YIRvIAufChq3QDp+zlAn67PuGPGcn7W8QraA0t4ucmOQ==
|
|
123
123
|
|
|
124
124
|
"@cloudflare/workers-response-store@0.1.0-beta.0":
|
|
125
125
|
version "0.1.0-beta.0"
|
|
@@ -947,9 +947,9 @@
|
|
|
947
947
|
integrity sha512-llBRm4dT4Z89aRsm6u2oEZ8tfwL/2l6BwpZ7JcyieouniDECM5AqNgr/y08zalEIvW3RSK4upYyybDcmjXqAow==
|
|
948
948
|
|
|
949
949
|
"@napi-rs/wasm-runtime@^1.1.4":
|
|
950
|
-
version "1.2.
|
|
951
|
-
resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.
|
|
952
|
-
integrity sha512-
|
|
950
|
+
version "1.2.5"
|
|
951
|
+
resolved "https://registry.yarnpkg.com/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.5.tgz#8c728c07e2543d80e55ccb34158c4ae9d6bd13e8"
|
|
952
|
+
integrity sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA==
|
|
953
953
|
dependencies:
|
|
954
954
|
"@tybys/wasm-util" "^0.10.3"
|
|
955
955
|
|
|
@@ -2067,9 +2067,9 @@
|
|
|
2067
2067
|
integrity sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==
|
|
2068
2068
|
|
|
2069
2069
|
"@types/node@^22.20.3":
|
|
2070
|
-
version "22.20.
|
|
2071
|
-
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.20.
|
|
2072
|
-
integrity sha512-
|
|
2070
|
+
version "22.20.5"
|
|
2071
|
+
resolved "https://registry.yarnpkg.com/@types/node/-/node-22.20.5.tgz#afa7bde6da81b8b83ea4e2f020487e9b148c11fd"
|
|
2072
|
+
integrity sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==
|
|
2073
2073
|
dependencies:
|
|
2074
2074
|
undici-types "~6.21.0"
|
|
2075
2075
|
|
|
@@ -2220,9 +2220,9 @@
|
|
|
2220
2220
|
integrity sha512-zH4WbVl47rNGxG8Y7XoWJAc8e0VQFQ+r8Cuh0crv1L2SuNovDD3jMtxQDjzoS1b9hYaZXbds0CjRo5tSm7F9Zw==
|
|
2221
2221
|
|
|
2222
2222
|
"@vitejs/plugin-react@^6.1.1":
|
|
2223
|
-
version "6.1.
|
|
2224
|
-
resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-6.1.
|
|
2225
|
-
integrity sha512-
|
|
2223
|
+
version "6.1.2"
|
|
2224
|
+
resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-6.1.2.tgz#924d47e890a78cdf2b72f3f41fe8ab98e089b81e"
|
|
2225
|
+
integrity sha512-fhJNGUdscQa4HkI0xFxwonWyhnVReCPDbXI7FH7jmzpnVCrFQI7PRrhWecO263610vOrs9tr2Y4xcf8uAdFxbw==
|
|
2226
2226
|
dependencies:
|
|
2227
2227
|
"@rolldown/pluginutils" "^1.0.1"
|
|
2228
2228
|
|
|
@@ -2249,9 +2249,9 @@ acorn-loose@^8.3.0:
|
|
|
2249
2249
|
acorn "^8.15.0"
|
|
2250
2250
|
|
|
2251
2251
|
acorn@^8.12.1, acorn@^8.15.0:
|
|
2252
|
-
version "8.
|
|
2253
|
-
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.
|
|
2254
|
-
integrity sha512-
|
|
2252
|
+
version "8.19.0"
|
|
2253
|
+
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.19.0.tgz#6b26fd97ce1cc9dc50bdf7ad305e9f1384d4f28a"
|
|
2254
|
+
integrity sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==
|
|
2255
2255
|
|
|
2256
2256
|
aria-hidden@^1.2.4:
|
|
2257
2257
|
version "1.2.6"
|
|
@@ -2867,9 +2867,9 @@ linebreak@^1.1.0:
|
|
|
2867
2867
|
unicode-trie "^2.0.0"
|
|
2868
2868
|
|
|
2869
2869
|
lucide-react@^1.46.0:
|
|
2870
|
-
version "1.
|
|
2871
|
-
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-1.
|
|
2872
|
-
integrity sha512-
|
|
2870
|
+
version "1.52.0"
|
|
2871
|
+
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-1.52.0.tgz#9945c4edc9550be7cc79808ec8a510c80512c727"
|
|
2872
|
+
integrity sha512-TUgPtl5ZI9WgxOcbu4ckaC5B3l1qxPQrCMgb6OfUB9owx/OvSJfcf93SMgUWAxRw5/1XDfh9uI5F5iNGXCcGDQ==
|
|
2873
2873
|
|
|
2874
2874
|
magic-string@^0.30.11, magic-string@^0.30.21:
|
|
2875
2875
|
version "0.30.21"
|
|
@@ -2879,9 +2879,9 @@ magic-string@^0.30.11, magic-string@^0.30.21:
|
|
|
2879
2879
|
"@jridgewell/sourcemap-codec" "^1.5.5"
|
|
2880
2880
|
|
|
2881
2881
|
magic-string@^1.2.3:
|
|
2882
|
-
version "1.4.
|
|
2883
|
-
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-1.4.
|
|
2884
|
-
integrity sha512-
|
|
2882
|
+
version "1.4.3"
|
|
2883
|
+
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-1.4.3.tgz#a0887990507b2ffbcdbc367a8759ed97e0b1233b"
|
|
2884
|
+
integrity sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==
|
|
2885
2885
|
dependencies:
|
|
2886
2886
|
"@jridgewell/sourcemap-codec" "^1.6.0"
|
|
2887
2887
|
|
|
@@ -2898,22 +2898,22 @@ micromatch@^4.0.8:
|
|
|
2898
2898
|
braces "^3.0.3"
|
|
2899
2899
|
picomatch "^2.3.1"
|
|
2900
2900
|
|
|
2901
|
-
miniflare@5.
|
|
2902
|
-
version "5.
|
|
2903
|
-
resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-5.
|
|
2904
|
-
integrity sha512-
|
|
2901
|
+
miniflare@5.20261001.0-alpha:
|
|
2902
|
+
version "5.20261001.0-alpha"
|
|
2903
|
+
resolved "https://registry.yarnpkg.com/miniflare/-/miniflare-5.20261001.0-alpha.tgz#d001ade0c85032840ab022f4f11d53fd998ac298"
|
|
2904
|
+
integrity sha512-GaimS5mSIOMyvd16ga+e1/QkI8cmp3z35QPHFex0DktqNQf2RVZQwMPQXdyoUreUiFP/0Gpe2MoQInTyMAD5xA==
|
|
2905
2905
|
dependencies:
|
|
2906
2906
|
"@cspotcode/source-map-support" "0.8.1"
|
|
2907
2907
|
sharp "0.35.4"
|
|
2908
2908
|
undici "7.29.1"
|
|
2909
|
-
workerd "1.
|
|
2909
|
+
workerd "1.20261001.1"
|
|
2910
2910
|
ws "8.21.0"
|
|
2911
2911
|
youch "4.1.0-beta.10"
|
|
2912
2912
|
|
|
2913
|
-
nanoid@^3.3.
|
|
2914
|
-
version "3.3.
|
|
2915
|
-
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.
|
|
2916
|
-
integrity sha512-
|
|
2913
|
+
nanoid@^3.3.19:
|
|
2914
|
+
version "3.3.20"
|
|
2915
|
+
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.20.tgz#dfd4444d85aa10111ef66ba85ed72e08ba0855d8"
|
|
2916
|
+
integrity sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==
|
|
2917
2917
|
|
|
2918
2918
|
nanostores@^1.3.0:
|
|
2919
2919
|
version "1.5.4"
|
|
@@ -2974,13 +2974,13 @@ postcss-value-parser@^4.0.2, postcss-value-parser@^4.2.0:
|
|
|
2974
2974
|
integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==
|
|
2975
2975
|
|
|
2976
2976
|
postcss@^8.5.16, postcss@^8.5.28:
|
|
2977
|
-
version "8.5.
|
|
2978
|
-
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.
|
|
2979
|
-
integrity sha512-
|
|
2977
|
+
version "8.5.29"
|
|
2978
|
+
resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.29.tgz#086a0ded2c0257c71efb8c68776b477774714b4a"
|
|
2979
|
+
integrity sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==
|
|
2980
2980
|
dependencies:
|
|
2981
|
-
nanoid "^3.3.
|
|
2981
|
+
nanoid "^3.3.19"
|
|
2982
2982
|
picocolors "^1.1.1"
|
|
2983
|
-
source-map-js "^1.2.
|
|
2983
|
+
source-map-js "^1.2.2"
|
|
2984
2984
|
|
|
2985
2985
|
pvtsutils@^1.3.6:
|
|
2986
2986
|
version "1.3.6"
|
|
@@ -3239,7 +3239,7 @@ sonner@^2.0.8:
|
|
|
3239
3239
|
resolved "https://registry.yarnpkg.com/sonner/-/sonner-2.0.8.tgz#dbfa02bb4eb0924616800a4594e9a455a9a195ac"
|
|
3240
3240
|
integrity sha512-UM/ByIoFra8yzV75n1o0Puu0bw5U/9UNnDacrJNspekBewIfsQ3D6ez1nvlWpt7aTsO6rujQtifBpycwIivqlg==
|
|
3241
3241
|
|
|
3242
|
-
source-map-js@^1.2.1:
|
|
3242
|
+
source-map-js@^1.2.1, source-map-js@^1.2.2:
|
|
3243
3243
|
version "1.2.2"
|
|
3244
3244
|
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.2.tgz#79fb88d97535a21cb27162cb05d211b67acea4ab"
|
|
3245
3245
|
integrity sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==
|
|
@@ -3486,30 +3486,30 @@ webpack-sources@^3.2.0:
|
|
|
3486
3486
|
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.6.0.tgz#b2e4a4f1aef1a0d60f3011eb47736c5bf7f1ed7f"
|
|
3487
3487
|
integrity sha512-EIMmPVvNI0CYXyRPp34F2Qk7W37/BZVZIofS6LAUnrNjCVahS+hO4mxwFJDjQjODTGZDtVzLYoN2+1dYkhk9qA==
|
|
3488
3488
|
|
|
3489
|
-
workerd@1.
|
|
3490
|
-
version "1.
|
|
3491
|
-
resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.
|
|
3492
|
-
integrity sha512-
|
|
3489
|
+
workerd@1.20261001.1:
|
|
3490
|
+
version "1.20261001.1"
|
|
3491
|
+
resolved "https://registry.yarnpkg.com/workerd/-/workerd-1.20261001.1.tgz#bca5d02ce6a7bff74bccd7b16cbfa5b5be32f12f"
|
|
3492
|
+
integrity sha512-d/SIYHFO0PT/wiFZg8in4NpRIxYuFwslX1HdylOtWkBIIUmSpkGFhK820cV84XACFylwJ48xuRoWW/8DWDPsPQ==
|
|
3493
3493
|
optionalDependencies:
|
|
3494
|
-
"@cloudflare/workerd-darwin-64" "1.
|
|
3495
|
-
"@cloudflare/workerd-darwin-arm64" "1.
|
|
3496
|
-
"@cloudflare/workerd-linux-64" "1.
|
|
3497
|
-
"@cloudflare/workerd-linux-arm64" "1.
|
|
3498
|
-
"@cloudflare/workerd-windows-64" "1.
|
|
3494
|
+
"@cloudflare/workerd-darwin-64" "1.20261001.1"
|
|
3495
|
+
"@cloudflare/workerd-darwin-arm64" "1.20261001.1"
|
|
3496
|
+
"@cloudflare/workerd-linux-64" "1.20261001.1"
|
|
3497
|
+
"@cloudflare/workerd-linux-arm64" "1.20261001.1"
|
|
3498
|
+
"@cloudflare/workerd-windows-64" "1.20261001.1"
|
|
3499
3499
|
|
|
3500
|
-
wrangler@4.
|
|
3501
|
-
version "4.
|
|
3502
|
-
resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-4.
|
|
3503
|
-
integrity sha512-
|
|
3500
|
+
wrangler@4.147.0, wrangler@^4.132.0:
|
|
3501
|
+
version "4.147.0"
|
|
3502
|
+
resolved "https://registry.yarnpkg.com/wrangler/-/wrangler-4.147.0.tgz#636f56e1d28c4cc046802d4f031e73030b1f53cd"
|
|
3503
|
+
integrity sha512-pQYRoiq8PTAxphaG69z8+GC1DkSGd19EDZehQ8zxjo/Ko3mRB6Qs1mTrd8ZuKAarLklIjTqr1lUdCK9r4q2hUg==
|
|
3504
3504
|
dependencies:
|
|
3505
3505
|
"@cloudflare/kv-asset-handler" "0.5.0"
|
|
3506
3506
|
"@cloudflare/unenv-preset" "2.16.2"
|
|
3507
3507
|
blake3-wasm "2.1.5"
|
|
3508
3508
|
esbuild "0.28.1"
|
|
3509
|
-
miniflare "5.
|
|
3509
|
+
miniflare "5.20261001.0-alpha"
|
|
3510
3510
|
path-to-regexp "6.3.0"
|
|
3511
3511
|
unenv "2.0.0-rc.24"
|
|
3512
|
-
workerd "1.
|
|
3512
|
+
workerd "1.20261001.1"
|
|
3513
3513
|
optionalDependencies:
|
|
3514
3514
|
fsevents "2.3.3"
|
|
3515
3515
|
|
|
@@ -16,8 +16,31 @@ import { sendEmailCode, sendMagicLink, sendPasswordReset, sendTwoFactorCode, sen
|
|
|
16
16
|
|
|
17
17
|
const vars = process.env as Record<string, string | undefined>;
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Optional: set when serving from a custom domain (e.g. https://example.com).
|
|
21
|
+
*
|
|
22
|
+
* Better Auth compares the request's Origin header against this string, and an Origin never
|
|
23
|
+
* carries a trailing slash. So `https://example.com/` — which is what you get copying a
|
|
24
|
+
* domain out of a browser bar or the Vercel dashboard — matches nothing, and every sign-in
|
|
25
|
+
* comes back 403 with nothing in the log saying why. Correct it and say so: a warning that
|
|
26
|
+
* leaves sign-in broken is not much better than the silence it replaces.
|
|
27
|
+
*/
|
|
28
|
+
function authBaseURL(raw: string | undefined): string | undefined {
|
|
29
|
+
const value = raw?.trim();
|
|
30
|
+
if (!value) return undefined;
|
|
31
|
+
// Only a trailing slash is removed. A path stays: an app served under one legitimately
|
|
32
|
+
// sets BETTER_AUTH_URL to https://example.com/app.
|
|
33
|
+
const url = value.replace(/\/+$/, "");
|
|
34
|
+
if (url !== value) {
|
|
35
|
+
console.warn(`[auth] BETTER_AUTH_URL has a trailing slash, which never matches an Origin header and makes every sign-in 403. Using "${url}" — set BETTER_AUTH_URL to that to silence this.`);
|
|
36
|
+
}
|
|
37
|
+
if (url && !/^https?:\/\//.test(url)) {
|
|
38
|
+
console.warn(`[auth] BETTER_AUTH_URL ("${url}") has no scheme, so it cannot match an Origin. Set it to a full origin, e.g. https://example.com.`);
|
|
39
|
+
}
|
|
40
|
+
return url || undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const configuredURL = authBaseURL(vars.BETTER_AUTH_URL);
|
|
21
44
|
|
|
22
45
|
/** A provider's credentials from the environment, when both are set. */
|
|
23
46
|
function credentials(prefix: string) {
|