gornostay25 / svelte-adapter-bun

A SvelteKit adapter for Bun
MIT License
534 stars 33 forks source link

Issues with ORIGIN env var - sveltekit app not recognized as https #33

Closed thomasmol closed 1 year ago

thomasmol commented 1 year ago

I am running a SvelteKit app on Railway and the ORIGIN env var does not show up when I list Bun.env (I created an API endpoint to check this during runtime). Other variables are showing.

thomasmol commented 1 year ago

Okay it does show up but I am having issues with using Auth.js on Railway. The callbackURL cookie is always set with 'http' and not 'https', which causes Auth.js to throw an XSS error. I built an exact copy of my app but then using Node and the svelte node adapter and there I have no issues.

Check them here: Bun version https://todos-bun.up.railway.app; Node version https://todos-node-sk-drizzle-production.up.railway.app.

Go to the /auth/signin page and you'll see in the cookies that the node version has a callback url cookie with https and the bun version has a callback url cookie with http. Only difference in code is the svelte adatper.