Fails
Sign-in redirect that drops the form
Live preview
const response = await fetch("/api/claims", { method: "POST", body: new FormData(claimForm) });if (response.status === 401) { // Session expired: everything in the form is thrown away location.href = "/sign-in";}
When the session has expired, the user is sent to sign in and afterwards has to start the claim again. Everything they typed is lost.