Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 5362c4a

Browse files
author
Alexander Hälbich
committed
Add the websiteId to the storeViews and use it when calling reset-password
1 parent 6038563 commit 5362c4a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config/default.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"storeCode": "de",
5858
"disabled": false,
5959
"storeId": 3,
60+
"websiteId": 1,
6061
"name": "German Store",
6162
"url": "/de",
6263
"elasticsearch": {
@@ -87,6 +88,7 @@
8788
"storeCode": "it",
8889
"disabled": false,
8990
"storeId": 4,
91+
"websiteId": 1,
9092
"name": "Italian Store",
9193
"url": "/it",
9294
"elasticsearch": {

src/api/user.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,14 @@ export default ({config, db}) => {
131131
*/
132132
userApi.post('/reset-password', (req, res) => {
133133
const userProxy = _getProxy(req)
134+
const storeCode = req.query.storeCode
135+
const websiteId = config.storeViews[storeCode].websiteId
134136

135137
if(!req.body.email) {
136138
return apiStatus(res, "Invalid e-mail provided!", 500)
137139
}
138140

139-
userProxy.resetPassword({ email: req.body.email, template: "email_reset", websiteId: 1 }).then((result) => {
141+
userProxy.resetPassword({ email: req.body.email, template: "email_reset", websiteId: websiteId }).then((result) => {
140142
apiStatus(res, result, 200);
141143
}).catch(err=> {
142144
apiError(res, err);

0 commit comments

Comments
 (0)