Repository navigation
fix: harden storefront checkout and authentication - #15
Merged
Merged
Conversation
Treat asynchronous Stripe payment failure as terminal by cancelling the unpaid order and restoring its reserved inventory atomically. Make duplicate failures and stale failure events after successful payment idempotent, with model and webhook coverage for both boundaries.
Persist the checkout key, selected addresses, and cart lines before contacting the service so retries recover the same local order and Stripe idempotency key. Discard attempts after definitive client errors, retain them across network and server failures, and label the recovery action clearly in the checkout UI.
Exercise the customer checkout component through repeated ambiguous failures and assert that every retry reuses the same key, addresses, variants, and quantities.
Cover paid and failed return-page states so the cart clears only after Silk reports successful payment and remains available after a terminal failure. Give failed, expired, and cancelled attempts explicit unsuccessful-payment copy instead of leaving customers on a misleading confirmation message.
Point success and cancellation redirects at the current port 4321 routes and preserve the order PID required by the status pages. Clarify that Stripe CLI and registered Dashboard webhook destinations issue different signing secrets for local and deployed environments.
Replace the storefront navigation on authentication routes with a focused Silk header and a direct path back to the catalogue. Constrain the split auth layout to a dynamic viewport grid and crop its editorial image without allowing intrinsic image dimensions to expand the page. Cover login and registration viewport stability across desktop and mobile browser projects.
Keep React Hook Form and the Zod resolver as the hydrated validation and submission path for sign-in, registration, password reset, and recovery. Declare explicit POST actions for native form fallback behavior so credentials never appear in URL query parameters before React hydrates. Add unit and browser coverage for schema validation, POST semantics, and credential privacy with JavaScript disabled.
Permit Astro development requests from localhost and the loopback address on port 4321 while retaining the existing admin origins. Update the development configuration contract test to guard the complete allowed-origin list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
Checkout requests could create duplicate attempts after ambiguous network failures, and failed payments did not consistently release reserved stock. Authentication pages also exposed credentials in the URL when submitted before React hydration because the native form defaulted to GET.
This PR makes payment recovery idempotent, keeps inventory state consistent, and ensures authentication remains secure and usable before and after hydration.
Impact
Validation
cargo test --test mod config::loads_development_config_from_yaml -- --exact --nocaptureThe full browser run still exposes an unrelated existing empty-cart assertion failure; authentication coverage in that run passed.