resetPassword mutation
The resetPassword mutation resets customer password using a reset password token and the customer's email address. Use it to set a new password for the registered customer after calling the requestPasswordResetEmail mutation.
The new password must satisfy the password policies set for the store.
The mutation returns true if the request was successful. Otherwise, it returns false.
data-variant=info
data-slots=text
The reset password token value can also be found in the
customer_entity.rp_token database table.Syntax
mutation: {resetPassword(email: String!, resetPasswordToken: String!, newPassword: String!): Boolean}
Reference
The resetPassword reference provides detailed information about the types and fields defined in this mutation.
Example usage
The following call sets a new customer password.
Request:
mutation {
resetPassword(
email: "roni_cost@example.com",
resetPasswordToken: "gh80pkjGdsPyiXc0sUUXswX1uGN7crUr",
newPassword: "new_password"
)
}
Response:
{
"data": {
"resetPassword": true
}
}
Errors
Error
Description
Cannot set the customer's passwordA general error message that appears on some internal system errors. The original error is logged and can be found in the application logs.
newPassword must be specifiedThe
newPassword argument is empty.resetPasswordToken must be specifiedThe
resetPasswordToken argument is empty.The account is lockedYou cannot modify a locked customer account.
The email address has an invalid format.The value provided in the
email argument has an invalid format.You must specify an email address.The
email argument is empty.