vendure-ecommerce / storefront-remix-starter

A storefront starter kit for Vendure built with Remix
https://remix-storefront.vendure.io
188 stars 105 forks source link

Log-out is possibly not reflected until full refresh #70

Open floze opened 8 months ago

floze commented 8 months ago

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

kyunal commented 8 months ago

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!