fix(web): relay rotated session cookie on admin redirects (BUNYIP-67) #85
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/bunyip-67-admin-redirect-cookies"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Nine admin handlers in
bunyip-web/src/handlers/admin.rsended their post-action redirect with a plainredirect(path), dropping any session cookie the admin guard rotated during the request (a refreshed JWT). When the guard rotated the cookie, the browser kept the stale one; if the old cookie had already expired, the admin was silently logged out on the next request. The action itself still succeeded (the API call runs before the redirect), so only the cookie relay was lost. The user-management handlers and the BUNYIP-65application_deletefix already useredirect_cookies; these nine had diverged.Fix
Switch all nine to
redirect_cookies(path, &c.set_cookies), converging the admin module on one redirect convention. No behavior change beyond the cookie relay; the API calls and redirect targets are unchanged.Handlers fixed:
feedback_status,application_field,application_distribution_save(success arm),application_create(success arm),set_app_restricted,grant_user_entitlement_h,revoke_user_entitlement_h,tier_settings_save,stripe_save. The error arms of the twoapplication_*handlers already relayed cookies viaadmin_responseand are untouched.redirectis no longer referenced in the module, so it is dropped from the import.Test
just check-containergreen: fmt + clippy (-D warnings, which catches the now-unused import) + workspace lib tests. Grep confirms no remaining plainredirect(in an admin handler.#BUNYIP-67