Closed fkrauthan closed 1 year ago
You need to clone the request before calling authenticator.authenticate
if you plan to read the FormData
let formData = await request.clone().formData()
await authenticator.authenticate('strategy', request, options);
Ah cool, I will give that a try. Might be worth documenting as the error you get is not very obvious and especially in cases like password reset or activation this might be a sort of common use-case.
Describe the bug
I am trying to implement some additional processing on top of
authenticator.authenticate
that requires me to accessformData
before callingauthenticate
. However, given that formData can only be read once it errors out during theauthenticate
call.Your Example Website or App
NA
Steps to Reproduce the Bug or Issue
await request.formData();
await authenticator.authenticate('form-login', request, {});
Expected behavior
It works fine and logs me in (and/or allows me to pass in the already parsed
formData
)Screenshots or Videos
No response
Platform
Additional context
No response