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

Conversation

@haelbichalex
Copy link
Contributor

A user is associated to a website. Currently when using the reset password modal, a request is sent to the vue-storefront-api with the given email:

userApi.post('/reset-password', (req, res) => {
  const userProxy = _getProxy(req)

  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) => {
    apiStatus(res, result, 200);
  }).catch(err=> {
    apiError(res, err);
  })
});

You see there is a hard coded websiteId "1" here.
If the current store is not associated to this website, you get the following error:
No such entity with email=user@example.com, websideID=1


This PR introduces the websiteId to the storeViews config and uses this value when calling the reset-password endpoint.
This fixes vuestorefront/vue-storefront#3695.

@andrzejewsky
Copy link
Contributor

Hey @haelbichalex thanks for the PR, can you please change destination branch to release/v1.11-rc1 instead of master?

@andrzejewsky andrzejewsky changed the base branch from master to release/v1.11-rc1 November 12, 2019 09:27
@andrzejewsky andrzejewsky self-requested a review November 12, 2019 09:30
@haelbichalex
Copy link
Contributor Author

Hi @andrzejewsky. Sorry I didn't have time to change the base branch yesterday. Seems like you've done it yourself now 👍

@andrzejewsky
Copy link
Contributor

@haelbichalex yeah, just fixed conflicts. No worries, useful PR, thanks!

@andrzejewsky andrzejewsky merged commit 895cbb3 into vuestorefront:release/v1.11-rc1 Nov 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants