Security domains in SXA Storefront
When you create a site, you can configure the name of the security domain for the site in the Content Editor on the /sitecore/Content/<tenant>/<site>/Settings/Site Grouping/<storefront> item:
When you select the Commerce Foundation module when you create a tenant and select the Commerce Storefront Components module when you create a site, Sitecore creates and configures a domain with the same name as the site at the same time as it creates the site.
Sitecore Commerce Connect defines the Sitecore.Commerce.Providers.iDomainProvider interface. SXA Storefront includes an implementation of this provider interface in the SXA Storefront foundation layer. The domain provider returns the name of the security domain that is in use to Commerce Connect and Commerce Connect passes the domain name to the external commerce system with each API call.
If you change the domain on a site that already has customer accounts, the customers will lose access to the site unless you update the domain on the accounts.