Vue Storefront is now Alokai! Learn More
LogoutCustomer

LogoutCustomer

Implements LogoutCustomer Unified Method.

Source

import { defineApi, assertAuthorized } from "@vsf-enterprise/unified-api-sfcc";
import from "@vsf-enterprise/unified-api-sfcc/udl";

declare module "@vsf-enterprise/unified-api-sfcc" {
  interface LogoutCustomerExtendedArgs {}
}


export const logoutCustomer = defineApi.logoutCustomer(async (context) => {
  if (await assertAuthorized(context, { silent: true })) {
    await context.api.signOut();
  }
});