mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Guard clause: redirect to /guest when POST
When there is no connected user, and when the distributor doesn't allow guest orders, redirect on POST method
This commit is contained in:
@@ -22,6 +22,8 @@ class SplitCheckoutController < ::BaseController
|
||||
end
|
||||
|
||||
def update
|
||||
return redirect_to_guest if !spree_current_user && !@order.distributor.allow_guest_orders?
|
||||
|
||||
if confirm_order || update_order
|
||||
clear_invalid_payments
|
||||
advance_order_state
|
||||
|
||||
Reference in New Issue
Block a user