-
Notifications
You must be signed in to change notification settings - Fork 152
Allow changing logged in customers password with Graphql mutation #150
Allow changing logged in customers password with Graphql mutation #150
Conversation
@@ -5,6 +5,10 @@ type Query { | |||
customer: Customer @resolver(class: "Magento\\CustomerGraphQl\\Model\\Resolver\\Customer") @doc(description: "The customer query returns information about a customer account") | |||
} | |||
|
|||
type Mutation { | |||
changePassword(currentPassword: String!, newPassword: String!): Customer @resolver(class: "\\Magento\\CustomerGraphQl\\Model\\Resolver\\Customer\\Account\\ChangePassword") @doc(description:"Changes password for logged in customer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this mutation is in global scope, it is better to name it changeCustomerPassword
} | ||
} | ||
|
||
public function testGuestUserCannotChangePassword() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to make sure that the password can be changed only if correct current password was specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@austris-argalis thank you for contribution, please see several comments above.
@paliarush thanks for review! |
Hello, @austris-argalis |
Hello, @austris-argalis Pls check
|
Hey, @naydav Is there something specific about the env this output is from that could help me with debugging?
but don't know how to reproduce such conditions. |
@austris-argalis |
- Merge Pull Request magento-engcom/import-export-improvements#150 from denispapec/import-export-improvements:phpstan-cleanuphistoryfile - Merged commits: 1. dd8625e
Description
Added a resolver which updates customer password. In response returns Customer object (not sure whether this is necessary).
Fixed Issues (if relevant)
Manual testing scenarios
curl -XPOST -H "Content-Type: application/json" -b PHPSESSID=d4d1cbf0ad346103fffc1b71d8059bc7 \ -d '{"query": "mutation {changePassword(currentPassword: \"password\", newPassword: \"newPassword123\") {id, email, firstname, lastname}}","variables": [],"operationName": null}' \ http://magento23.local/graphql
Contribution checklist