storefront-remix-starter icon indicating copy to clipboard operation
storefront-remix-starter copied to clipboard

Log-out is possibly not reflected until full refresh

Open floze opened this issue 1 year ago • 1 comments

The user is currently able to log out from /account/history, /account/addresses and /account/password, so this mechanism should be revised: https://github.com/vendure-ecommerce/storefront-remix-starter/blob/e32cebdf914a5667cabca5d45089a0865489a248/app/root.tsx#L57

Otherwise the log-out does not get reflected until a full refresh.

Also, not re-validating root upon removing all items from the cart during /checkout gets you redirected to root and the activeOrderFetcher being hung in loading state. This issue might be relevant: https://github.com/remix-run/remix/issues/8298

floze avatar Feb 01 '24 16:02 floze

Thanks for pointing out this oversight. I think maybe we could use something like the useRevalidator hook which would offer greater flexibility instead of having these paths (or conditions) hardcoded. The simple solution would be to just check if the currentUrl starts with /account I suppose.

I will see if I can tackle this, but contributions are welcome!

kyunal avatar Feb 04 '24 14:02 kyunal