Closed MikaelJohnAndersson closed 9 months ago
So it seems it was a user error, not entirely unexpected :) Turns out I set my auth cookie on the response headers in hooks.server.ts
using Headers.set(), effectively overwriting the flash cookie.
Solution was to use Headers.append(), preserving the flash cookie in the response. Closing this as completed.
Sorry if I'm missing something obvious, I'm having issues trying to retrieve flash messages after a redirect in a form action. I'm also using layout groups and found #23. Seems similar but might be unrelated.
Top level layout with a conditional redirect if no user exist:
Route where I want to redirect with a flash message on success:
The redirect works fine, but
$flash
is always undefined. If the edit results in an error, I'm also tryingsetFlash
and returningfail()
as the docs suggests, with same results ($flash
is undefined).I'm using version
2.2.1
, and I should also mention I'm using superforms, if that might be relevant.