customerChangePassword
Change customer password.
It sends a request to commercetools GraphQL API to change the customer's password based on the Password Flow.
By default, it uses the customerChangeMyPasswordDefaultQuery GraphQL query
Signature
declare function customerChangePassword(
context: CommercetoolsIntegrationContext,
version: string,
currentPassword: string,
newPassword: string
): Promise<CustomerChangeMyPasswordResponse>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | CommercetoolsIntegrationContext | |
version | Required | string | |
currentPassword | Required | string | |
newPassword | Required | string |
Returns
Returns a representation of the CustomerChangeMyPasswordResponse.
Referenced Types
Examples
This example shows how to change the customer's password:
// Change password
await sdk.commerce.customerChangePassword(user.version, 'current_password', 'new_password');