Patch Changes
-
Fixed build failures in Cloudflare Workers and Mini-Oxygen environments caused by Node.js-specific imports in virtual routes module. (#3267) by @darintanakaFN
-
Adds two new optional parameters to the
customerAccount.login()method for more control over the authentication flow: (#3358) by @lihaokxacrValuesSpecifies Authentication Context Class Reference values, which can be used to request specific authentication methods or identity providers. When provided, it's passed as the
acr_valuesquery parameter to the OAuth authorization URL.Common use case: Triggering social login flows (e.g.,
'provider:google'to initiate Google sign-in).loginHintPre-populates the login form with an email address. When provided, it's passed as the
login_hintquery parameter to the OAuth authorization URL.Common use case: Streamlining the login experience when you already know the user's email from a previous interaction.
Usage
// Trigger Google social login await context.customerAccount.login({ acrValues: 'provider:google', }); // Pre-fill email on login form await context.customerAccount.login({ loginHint: 'customer@example.com', }); // Combine with existing options await context.customerAccount.login({ countryCode: context.storefront.i18n.country, acrValues: 'provider:google', loginHint: 'customer@example.com', });
Migration
This is a non-breaking change. Both parameters are optional and existing implementations will continue to work without modification.