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

updateUserLogin

Method that updates an existing customer login (email) in SAP Commerce Cloud.

This method sends a POST request to the updateUserLogin endpoint of the Alokai Middleware. In turn, it exchanges data with the replaceUserLogin 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 provided new login has to be a valid email address. The provided password has to be the current user's password.

Once the method is used, the customer has to sign in again with the new login to obtain a new access token.

Signature

export declare function updateUserLogin<Props extends UpdateUserLoginProps = UpdateUserLoginProps>(
	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 login.

import { sdk } from '~/sdk';

await sdk.commerce.updateUserLogin({
  newLogin: 'newlogin@gmail.com',
  password: 'test1234',
});

On this page