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.

Force to user `admin_user` in path for admin user rest (#12765)

Damian Legawiec720de3a86ecb
diff --git a/admin/app/views/spree/admin/user_passwords/edit.html.erb b/admin/app/views/spree/admin/user_passwords/edit.html.erb
index fa24ac1de1..071b6e98da 100644
--- a/admin/app/views/spree/admin/user_passwords/edit.html.erb
+++ b/admin/app/views/spree/admin/user_passwords/edit.html.erb
@@ -1,7 +1,7 @@
<% content_for(:title, Spree.t(:forgot_password)) %>
<h1 class="mb-3 font-weight-light"><%= Spree.t(:change_password) %></h1>
-<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }, data: { turbo_frame: :_top, turbo: false }) do |f| %>
+<%= form_for(resource, as: resource_name, url: password_path(:admin_user), html: { method: :put }, data: { turbo_frame: :_top, turbo: false }) do |f| %>
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: resource } %>
<%= f.hidden_field :reset_password_token %>
<div class="form-group mb-3">
diff --git a/admin/app/views/spree/admin/user_passwords/new.html.erb b/admin/app/views/spree/admin/user_passwords/new.html.erb
index 21e28a74fe..81347cd14c 100644
--- a/admin/app/views/spree/admin/user_passwords/new.html.erb
+++ b/admin/app/views/spree/admin/user_passwords/new.html.erb
@@ -1,7 +1,7 @@
<% content_for(:title, Spree.t(:forgot_password)) %>
<h1 class="mb-3 font-weight-light"><%= Spree.t(:forgot_password) %></h1>
-<%= form_for(resource, as: resource_name, url: password_path(resource_name), data: { turbo_frame: :_top }) do |f| %>
+<%= form_for(resource, as: resource_name, url: password_path(:admin_user), data: { turbo_frame: :_top }) do |f| %>
<div class="form-group mb-3">
<%= f.label :email, Spree.t(:email), required: true, class: 'form-label' %>
<%= f.email_field :email, required: true, class: 'form-control form-control-lg rounded-sm', placeholder: '[email protected]', data: { enable_button_target: :input }, autocomplete: :email, autofocus: true %>