You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in honojs/hono#2681 (comment), the auth-js middleware sends back responses using new Response instead of c.body which causes the response headers to get lost in a production environment. This breaks server-side redirects and unfortunately isn't caught by the test suite since app.request doesn't mimic real networking conditions.
The fix here is to use c.body for returning responses, but I think there's something else that needs fixing since switching to that breaks several other tests which I can't figure out the reason for. Anywho, thank you and looking forward to hearing back!
Expected GET/api/auth/callback/postmark?confirmationToken=abc on already used token -> 302 to /api/error?error=Verification
Actual GET/api/auth/callback/postmark?confirmationToken=abc on already used token -> 200 response with no redirect
The text was updated successfully, but these errors were encountered:
williamrobertson13
changed the title
[@hono/auth-js] server-side redirects are broken due to headers not being copied
[@hono/auth-js] certain redirects are broken due to headers not being copied
Dec 19, 2024
As mentioned in honojs/hono#2681 (comment), the auth-js middleware sends back responses using
new Response
instead ofc.body
which causes the response headers to get lost in a production environment. This breaks server-side redirects and unfortunately isn't caught by the test suite sinceapp.request
doesn't mimic real networking conditions.The fix here is to use
c.body
for returning responses, but I think there's something else that needs fixing since switching to that breaks several other tests which I can't figure out the reason for. Anywho, thank you and looking forward to hearing back!Expected
GET
/api/auth/callback/postmark?confirmationToken=abc
on already used token ->302
to/api/error?error=Verification
Actual
GET
/api/auth/callback/postmark?confirmationToken=abc
on already used token ->200
response with no redirectThe text was updated successfully, but these errors were encountered: