vuestorefront-community / vendure

Vue Storefront 2 integration for Vendure
https://docs.vuestorefront.io/vendure/
MIT License
72 stars 51 forks source link

HTTP 500 calling /api/vendure/resetPassword #205

Closed OlegKunitsyn closed 2 years ago

OlegKunitsyn commented 2 years ago

Reproduction Create a password-reset token, then try

const {setNew} = useForgotPassword();
await setNew({
  tokenValue: 'mytoken',
  newPassword: 'mypassword,
});

HTTP request [{"tokenValue":"mytoken","newPassword":"mypassword"},null]

HTTP response {"graphQLErrors":[],"networkError":{"name":"ServerError","response":{"size":0,"timeout":0},"statusCode":400,"result":{"errors":[{"message":"Variable \"$token\" of required type \"String!\" was not provided.","locations":[{"line":1,"column":32}]},{"message":"Variable \"$password\" of required type \"String!\" was not provided.","locations":[{"line":1,"column":49}]}]}},"message":"Network error: Response not successful: Received status code 400"}

See https://github.com/vuestorefront/template-magento/blob/main/pages/ResetPassword.vue

Baroshem commented 2 years ago

@OlegKunitsyn

Thanks for reporting that.

There seems to be an issue with parameter names. Mutation expects the variable with the name token, while it receives a variable with name tokenValue. Would you like to create a pull request with a fix? It should be rather a single line change :)