Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fix: disable Turbo for sign-out to allow following different hosts fo… (#14283)

Damian Legawiec8fdc192f575c
diff --git a/spree/admin/app/views/spree/admin/shared/_user_dropdown.html.erb b/spree/admin/app/views/spree/admin/shared/_user_dropdown.html.erb
index 15a6496ed3..881b0bdb9e 100644
--- a/spree/admin/app/views/spree/admin/shared/_user_dropdown.html.erb
+++ b/spree/admin/app/views/spree/admin/shared/_user_dropdown.html.erb
@@ -44,8 +44,11 @@
<div class="dropdown-divider"></div>
- <%= button_to spree_admin_logout_path, class: 'dropdown-item text-danger hover:bg-red-100 mb-0', method: :delete do %>
- <%= icon('logout', class: "icon icon-logout") %>
+ <%# Turbo is disabled so the browser follows the sign-out redirect
+ natively — apps may redirect to a different host (e.g. multi-tenant
+ setups), which Turbo's fetch cannot follow cross-origin. %>
+ <%= button_to spree_admin_logout_path, class: 'dropdown-item text-danger hover:bg-red-100 mb-0', method: :delete, form: { data: { turbo: false } } do %>
+ <%= icon('logout', class: "icon icon-logout") %>
<%= Spree.t(:logout) %>
<% end if defined?(spree_admin_logout_path) %>
<% end %>