fermyon / leptos-spin

Integration library for running server-side Leptos apps on Spin
31 stars 6 forks source link

Add server side redirects for basic forms and action forms with no js #32

Closed benwis closed 7 months ago

benwis commented 7 months ago

Instead of only handling ActionForm/form submission in JS/WASM, implement default redirect of server functions back to the referrer

benwis commented 7 months ago

Thanks for catching and addressing this! It does make me wonder how much of this processing is generic across Leptos environments vs specific to Spin - but I'm sure you and other Leptos maintainers are more conscious than I am of the trade offs. Regardless of any hypothetical consolidation, it's great to have this here.

This is 100% generic to all the Leptos integrations, we want to have server functions/forms work in a reasonable way with no js, so all of them will look for the headers and potentially setup a redirect server side to the referrer.