Hi,
I have a Turbo-enabled login form
<%= form_with url: session_path do |form| %>
As expected this sends the following request to my login controller:
Request
POST /session HTTP/1.1
Accept: text/vnd.turbo-stream.html, text/html, application/xhtml+xml
On success, I redirect to the previous url:
redirect_to after_authentication_url, status: :see_other
Now the problem is, Turbo tries to open that URL still with the turbo-stream
Accept header:
Request
GET /
Accept: text/vnd.turbo-stream.html, text/html, application/xhtml+xml
This particular action is available in html and turbo-stream format, but for the initial page load I need it to load in html format.
I can get this to work by adding data: { turbo: false }
to the form but was wondering if there is a way to keep Turbo for the login form and explicitly tell Turbo to follow the redirect in text/html format?
Thank you