Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback and Signin URL not set to https when using Bun runtime #8882

Closed
thomasmol opened this issue Oct 17, 2023 · 1 comment
Closed

Callback and Signin URL not set to https when using Bun runtime #8882

thomasmol opened this issue Oct 17, 2023 · 1 comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@thomasmol
Copy link

thomasmol commented Oct 17, 2023

Environment

  • Hosted on Railway.app
  • Bun 1.0.2
  • Node 18
  • @sveltejs/kit 1.20.4
  • svelte 4.0.5
  • svelte-adapter-bun 0.5.0
  • @auth/core 0.16.1
  • @auth/sveltekit 0.3.9
  • @auth/drizzle-adapter 0.3.3

Reproduction URL

https://github.com/thomasmol/todos-bun

Describe the issue

I am trying to configure Authjs with sveltekit and the new Bun runtime. All works as expected locally.
However on a live/hosted website I get the following errors:

I cannot figure out if this is a bug in the svelte-adapter-bun package or if it is a bug when using authjs + bun (I was thinking maybe authjs does not get the ORIGIN var properly somewhere).

I tried the exact same setup (same code) but with the node adapter for sveltekit and then it did work. When I change the ORIGIN env var in the node setup to an http url instead of https I get the same warnings and errors as with the Bun setup. That's why I think it has to do something with the ORIGIN env var.

Any ideas?
Or ideas how I can further debug this? Any help/guidance is appreciated!

How to reproduce

Setup authjs + sveltekit and run it on Bun runtime instead of node.
Check live version here: https://todos-bun-production.up.railway.app/auth/signin/email and repo here: https://github.com/thomasmol/todos-bun

Expected behavior

Callback/signin url and cookie to be set to https when on a https website

@thomasmol thomasmol added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Oct 17, 2023
@thomasmol
Copy link
Author

Okay I did some further testing and it looks like Authjs is not the issue, its probably the adapter. Authjs gets the origin/url from svelte's handle event and i just noticed the event.url is http where it should be https.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

1 participant