Repository navigation
fix(auth): prevent guest login prompt triggering on in-page actions - #414
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to Query-only Inertia events no longer trigger the guest prompt, while pathname changes still do. The inspected event contract matches this behavior, and no actionable merge risk remains. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review details
Pre-merge checks |
|
Summary
Problem
In
GuestLoginPrompt.vue, the component listened to Inertia'srouter.on('navigate')and unconditionally invokedevaluatePrompt(true)on every event. Because Inertia dispatches anavigateevent on partial reloads, data refreshes, and form/action interactions on the same page (e.g. closing modals with state reset or in-page actions),guest_browsing_page_countwas incremented and the guest login prompt popped up after 1.5 seconds even while staying on the same page.Solution
lastPath).navigate, we comparenextPathagainstlastPath.evaluatePrompt(true)) when the visitor actually navigates to a different page route.npm run build) succeeds.Summary by CodeRabbit