[英]Magento 2 CE customer update REST API not validating the password
用於更新客戶信息的Magento2 CE REST API不會使用實際密碼驗證給定的密碼,它接受一切。 如果用戶要更改其帳戶的電子郵件地址在Web上的何處,Magento將詢問密碼並對其進行驗證。 如果密碼輸入錯誤,將不允許我們更改密碼。
Content-Type : application/json
Authorization: Bearer "customerToken"
Method: PUT <base_url>/rest/V1/customers/:customerID
Request:
{
"customer": {
"id": "45338",
"email": "test230720195@yopmail.com",
"firstname": "Updatetest",
"lastname": "Testing",
"websiteId": 1
},
"password": "qawsedrf!"
}
還有其他API可以通過密碼驗證來更新客戶信息嗎?
-提前致謝。
要重置客戶密碼,您可以使用以下請求
Content-Type : application/json
Authorization: Bearer "authToken"
Method: PUT <base_url>/rest/V1/customers/me/password
Request:
{
"currentPassword": "string",
"newPassword": "string"
}
注意auth令牌是您獲得的值
/V1/integration/customer/token
對於您的問題中的請求,您應該使用來自
/V1/integration/admin/token
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.