Skip to content

[🐞] Bun adapter to support getOrigin like express adapter #291

@gnemanja

Description

@gnemanja

Which component is affected?

Qwik City (routing)

Describe the bug

I have NGINX setup as reverse proxy for my qwik city Bun server.

When trying to login with Google, i get this error:
Error 400: redirect_uri_mismatch.

Error description shows me that callback uri contains http instead of https.

I tried adding all the different headers through NGINX, didn't help.

Tried adding headers through env file. Didn't help.

Tried adding redirectProxyUrl in plugin@auth.ts, but then I get an error:
InvalidCheck: State cookie was missing

One guy on discord seemed to solve this issue by using getOrigin function in his entry.express.ts
But I am using Bun, not express.

Looking at source code for Node middleware, I tried changing Buns middleware on lines containing: new URL(request.url) to have https. Didn't help.

Thank You in advance!

Reproduction

impossible to reproduce (bun, nginx)

Steps to reproduce

No response

System Info

'@builder.io/qwik-city/middleware/bun'
'@auth/core'
'@builder.io/qwik-auth'
nginx

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    [STAGE-1.5] looking for championAdd this label after a proposal was discussed but is missing someone to implement it

    Type

    No type

    Projects

    Status

    In Progress (STAGE 2)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions