The customers/login template renders the customer login page, which hosts the form for logging into a customer account.


The customers/login template is located in the templates > customers directory of the theme:

└── theme
    ├── layout
    ├── templates
    |   └── customers
    |     ├── login.liquid
    |     ...


You should include the customer login form in your customers/login template or a section inside of the template.

You can include Forgot your password and guest checkout options.

The customer login form

The customer login form can be added to the form.


For example:

<form method="POST" action="{{ '/api/customers/sign_in' | add_root_url }}">
    <label for="email">Email</label>
    <input id="email" name="email" />
    <label for="password">Password</label>
    <input id="password" type="password" name="password" />
  <button type="submit" data-track="dj.login">Login</button>


When working with the customers/login template, you should familiarize yourself with the following:

Link to the login page

If the customer isn't logged in, then you can link to the login page. If the customer is logged in, then you can link to the order page instead.

{% if %}
  <a href="{{ routes.account_order_url }}">My orders</a>
{% else %}
  <a href="{{ routes.account_login_url }}">Login</a>
{% endif %}