Alokai
You are reading the documentation for v7.x and earlier, which is no longer the latest version. Switch to v8.x

changeUserPassword

Method changing a customer password in SAP Commerce Cloud.

This method sends a POST request to the changePassword endpoint of the Alokai Middleware. In turn, it exchanges data with the replaceUserPassword endpoint exposed by the SAP OCC API Users Controller.

This method works only in an authenticated user session (i.e. when the vsf-sap-token cookie is present in the browser). The new password must be at least six characters long as well as contain a special character (e.g "$"), an uppercase character and a number.

Signature

export declare function changeUserPassword<Props extends ChangePasswordProps = ChangePasswordProps>(
	props: Props,
	options?: MethodOptions
): Promise<void>;

Parameters

NameRequiredTypeDescription
propsRequiredPropsParameter object which can be used with this method. Refer to its type definition to learn about possible properties.
optionsOptionalMethodOptionsOptions that can be passed to additionally configure the request or customize the logic in a plugin.

Returns

This method does not return anything.

Referenced Types

Examples

Updating a customer password.

import { sdk } from '~/sdk';

await sdk.commerce.changeUserPassword({
  old: 'oldPassword1!',
  new: 'newPassword1!'
});

On this page