customer_accounts_login Function

The customer_accounts_login function allows you to include the login flow for a customer account on a page you author.

Usage

Use the customer_accounts_login() call on a page dedicated to the purpose of logging in customers. The script will render a single HTML element on the page, which contains a three step process for submitting and validating login information, as well as redirecting logged-in customers to the account portal.

Example

theme/templates/pages/customer-login.html.twig

<div>
{{ customer_accounts_login() }}
</div>

Dev notes

Including this tag will add a new object to the Square object on window, Square.customerAccountsLogin and a top level HTML container with the ID customer-accounts-login. The IDs for each sub-tag are:

  • sq-cal-initial-load
  • sq-cal-phone-input
  • sq-cal-phone-verification

Customer accounts login flow

The login flow consists of three steps. Either step 1 or 2 will load once the customer accounts has initialized via a ping API call.

  1. Initial information.
  2. Phone input.
  3. Phone verification.