diff --git a/config/default.json b/config/default.json index 14cf4b45..30c3cd73 100644 --- a/config/default.json +++ b/config/default.json @@ -62,6 +62,7 @@ "storeCode": "de", "disabled": false, "storeId": 3, + "websiteId": 1, "name": "German Store", "url": "/de", "elasticsearch": { @@ -96,6 +97,7 @@ "storeCode": "it", "disabled": false, "storeId": 4, + "websiteId": 1, "name": "Italian Store", "url": "/it", "elasticsearch": { diff --git a/src/api/user.js b/src/api/user.js index 1e978b50..5a2e17da 100755 --- a/src/api/user.js +++ b/src/api/user.js @@ -119,12 +119,14 @@ export default ({config, db}) => { */ userApi.post('/reset-password', (req, res) => { const userProxy = _getProxy(req) + const storeCode = req.query.storeCode + const websiteId = config.storeViews[storeCode].websiteId if (!req.body.email) { return apiStatus(res, 'Invalid e-mail provided!', 500) } - userProxy.resetPassword({ email: req.body.email, template: 'email_reset', websiteId: 1 }).then((result) => { + userProxy.resetPassword({ email: req.body.email, template: "email_reset", websiteId }).then((result) => { apiStatus(res, result, 200); }).catch(err => { apiError(res, err);