sergiodxa / remix-auth

Simple Authentication for Remix
https://sergiodxa.github.io/remix-auth/
MIT License
2k stars 110 forks source link

`authenticate` request parameter blank body #267

Closed danthegoodman1 closed 9 months ago

danthegoodman1 commented 9 months ago

Describe the bug

The request parameter of the authenticate function seems to have blank request bodies. Printing it provides:

Request (0 KB) {
  method: "POST",
  url: "http://localhost:8080/signin?failed=Missing+email+address.",
  headers: Headers {
    "host": "localhost:8080",
    "connection": "keep-alive",
    "content-length": "35",
    "pragma": "no-cache",
    "cache-control": "no-cache",
    "dnt": "1",
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "content-type": "application/x-www-form-urlencoded;charset=UTF-8",
    "accept": "*/*",
    "origin": "http://localhost:8080",
    "sec-fetch-mode": "cors",
    "sec-fetch-dest": "empty",
    "referer": "http://localhost:8080/signin?failed=Missing%20email%20address.",
    "accept-encoding": "gzip, deflate, br"
...

and await request.text() is blank

Everything else seems to be ok. I wonder if this is because of Bun. I am using 1.0.21. The body is available before passing to authenticator.authenticate in the action, and it also doesn't seem to care that it's trying to read the body twice when I do that.

Your Example Website or App

not public

Steps to Reproduce the Bug or Issue

console.log(request) in any authenticator implementation

Expected behavior

the body exists

Screenshots or Videos

No response

Platform

Additional context

related issue https://github.com/pbteja1998/remix-auth-email-link/issues/48

danthegoodman1 commented 9 months ago

Some base code to run remix with bun is at https://github.com/danthegoodman1/BunHonoRemixTemplate

danthegoodman1 commented 9 months ago

I suspect this is bun https://github.com/oven-sh/bun/pull/6468

I am now converting to nodejs

pain

danthegoodman1 commented 9 months ago

can confirm bun's fault!