fix(web): route verification-resend feedback back to the originating page #321
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-324-resend-verification-feedback"
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
The "Resend verification email" control lives on both
/settingsand/onboarding, and both forms POST to/settings/verify-email/resend. The handler (settings_resend_verification) always redirected its?ok=/?error=feedback to/settings. But an onboarding-incomplete user is bounced off/settingsright back to/onboardingby the onboarding gate (handlers::mod::guard->needs_onboarding), and that bounce drops the query param. So a user who clicked Resend from the onboarding page saw nothing: no "sent" confirmation, no throttle notice, no failure state. This is exactly the "user cannot tell if it was queued, attempted, or failed" symptom in BUNYIP-324. (From/settingsitself the feedback already worked.)Fix
settings_resend_verificationnow chooses the redirect target from the user's onboarding state:needs_onboarding == true->/onboarding, else/settings. The two pages are mutually exclusive by onboarding state, so this reconstructs the origin server-side with no client-supplied redirect target (no open-redirect surface). Both success and the BUNYIP-314 throttle/failure copy now land on whichever page the user was on.?error. It now also renders?okvia a newsuccess_boxhelper inviews/ui.rs(the teal-check counterpart toerror_box, matching the inline success banner/settingsalready uses), so the queued/accepted confirmation is visible.No new internals exposed: the success copy is the same "Verification email sent to
" the settings page already shows, and the failure copy is the existingverification_message()(throttle-aware, generic otherwise).Tests
onboarding_contentrender tests (bin unit tests,cargo test -p bunyip-web --bins):renders_queued_success_indication- success/queued banner shows when?okis set.renders_send_failure_indication- failure banner shows when?erroris set.no_feedback_boxes_when_both_none- clean page load stays clean.Verification
just check-containergreen (fmt + clippy-D warnings+ workspace lib tests). The web crate is bin-only, so its tests run under--bins, not--lib:cargo test -p bunyip-web --bins-> 68 passed, 0 failed (incl. the 3 new).Fixes BUNYIP-324.