Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intercepting post/redirect/get form submissions #116

Closed
domenic opened this issue May 20, 2021 · 0 comments · Fixed by #121
Closed

Intercepting post/redirect/get form submissions #116

domenic opened this issue May 20, 2021 · 0 comments · Fixed by #121

Comments

@domenic
Copy link
Collaborator

domenic commented May 20, 2021

A goal of app history is that you should be able to use the navigate handler to centrally convert MPA navs into SPA navs.

It'd be good to work out a detailed example of this for form submissions. In particular, given a typical post/redirect/get MPA flow where the <form> does a POST to /submission and the server then does a 303 redirect to /confirmation-page, what does that look like in a navigate handler?

If you just do event.respondWith(...), the URL will stay on /submission. So this speaks to some previous discussions about allowing a redirect-type flow within a navigate handler, so that you could do a client-side "redirect" to /confirmation-page. Then a second navigate event would fire for /confirmation-page, which would result in appropriate DOM updates showing the confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant