Alokai

signOut

Log out a shopper. The shopper's access token and refresh token are revoked. If the shopper authenticated with a B2C Commerce (ECOM) instance, the OCAPI JWT is also revoked. New guest JWT tokens are generated and returned, similar to a session timeout.

This should be called for Registered users that have logged in using SLAS. This endpoint is not for use with guest users.

This method runs for both OCAPI and SCAPI. In addition to customer data, it also returns updated JWT tokens and USID, similar to how guest authentication is handled. It communicates with the signOut endpoint of the Vue Storefront API Middleware. For OCAPI, it calls the Invalidate an existing customer JWT resource, passing the customer JWT as a bearer token in the authorization header. For SCAPI, it calls the logoutCustomer endpoint.

Signature

export declare function signOut(
	
): Promise<void>;

Examples

Sign out the currently signed-in customer

import { sdk } from '~/sdk.config.ts';

await sdk.commerce.signOut();

On this page