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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Consolidate customer creation params and support current_password (#13912)
Damian Legawiec852364a9b0df
diff --git a/spree/api/app/controllers/spree/api/v3/store/customers_controller.rb b/spree/api/app/controllers/spree/api/v3/store/customers_controller.rbindex 38638af166..11ddb45d31 100644--- a/spree/api/app/controllers/spree/api/v3/store/customers_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/customers_controller.rb@@ -10,7 +10,7 @@ module Spree# POST /api/v3/store/customersdef create- user = Spree.user_class.new(create_params)+ user = Spree.user_class.new(permitted_params.except(:current_password))if user.saverefresh_token = Spree::RefreshToken.create_for(user, request_env: {@@ -67,11 +67,6 @@ module Spree}end- def create_params- params.permit(:email, :password, :password_confirmation, :first_name, :last_name,- :phone, :accepts_email_marketing, metadata: {})- end-def permitted_paramsparams.permit(:email, :password, :password_confirmation, :first_name, :last_name,:accepts_email_marketing, :phone, :current_password, metadata: {})