<% content_for :title, "Sign in to GOV.UK" %>

<div class="govuk-grid-row">
  <div class="govuk-grid-column-one-half">
    <%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { autocomplete: 'on' }) do |f| %>
      <%= render "govuk_publishing_components/components/input", {
        label: {
          text: "Email"
        },
        name: "user[email]",
        type: "email"
      } %>

      <%= render "govuk_publishing_components/components/input", {
        label: {
          text: "Password"
        },
        name: "user[password]",
        type: "password"
      } %>

      <%= render "govuk_publishing_components/components/button", {
        text: "Sign in"
      } %>
    <% end %>

    <p class="govuk-body govuk-!-margin-top-5">
      <%= link_to t('devise.links.forgot_password'), new_password_path(resource_name), class: "govuk-link" %>
    </p>
  </div>
</div>

<% content_for :title, "Sign in to GOV.UK" %>

<div class="govuk-grid-row">
  <div class="govuk-grid-column-one-half">
    <%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { autocomplete: 'on' }) do |f| %>
      <%= render "govuk_publishing_components/components/input", {
        label: {
          text: "Email"
        },
        name: "user[email]",
        type: "email",
        autofocus: true,
        tabindex: 0
      } %>

      <%= render "govuk_publishing_components/components/input", {
        label: {
          text: "Password"
        },
        name: "user[password]",
        type: "password"
      } %>

      <%= render "govuk_publishing_components/components/button", {
        text: "Sign in"
      } %>
    <% end %>

    <p class="govuk-body govuk-!-margin-top-5">
      <%= link_to t('devise.links.forgot_password'), new_password_path(resource_name), class: "govuk-link" %>
    </p>
  </div>
</div>

Add autofocus on login page
Add autofocus on login page
