Skip to content

AuthModule

Module in @evolve-framework/sfcc

Sign-in for Salesforce Commerce Cloud: login, logout and token refresh, and the session routes a storefront calls before it has a token.

import { AuthModule } from "@evolve-framework/sfcc/modules";

Serves the Authentication part of the GraphQL API: cartMergeUndo, createGuestSession, customerLogin, customerLogout, customerPasswordReset, customerPasswordResetRequest, customerPasswordUpdate, refreshToken.

new AuthModule(options: { config: AuthModuleConfig; clientFactory: ClientFactory; })
OptionTypeDescription
configAuthModuleConfig

The SLAS client, site, organization and short code that guest and customer tokens are requested from, refreshed with and revoked against.

clientFactoryClientFactory

The client POST /api/client-context reads the signed-in customer through, as that customer.

AuthModuleConfig5The fields of config.
FieldTypeDescription
SFCC_CLIENT_IDstring
SFCC_SITE_IDstring
SFCC_ORGANIZATION_IDstring
SFCC_SHORT_CODEstring
SFCC_CLIENT_SECRET?string

Extends AbstractModule<SfccLoaderContext>.

The same module on commercetools and medusa.