<div id="login" v-cloak>
  <div class="container-fluid pt-5 pb-5">
    <h1 class="text-center"><%=__('Sign in to your account')%></h1>
    <div style="max-width: 450px;" class="mx-auto">
      <hr/>
      <ajax-form action="login" :syncing.sync="syncing" :cloud-error.sync="cloudError" :form-data="formData" :form-rules="formRules" :form-errors.sync="formErrors" @submitted="submittedForm()">
        <div class="form-group">
          <input type="email" class="form-control" placeholder="Email address" :class="[formErrors.emailAddress ? 'is-invalid' : '']" v-model.trim="formData.emailAddress" autocomplete="email" focus-first>
          <div class="invalid-feedback" v-if="formErrors.emailAddress"><%=__('Please provide a valid email address')%>.</div>
        </div>
        <div class="form-group">
          <input type="password" class="form-control" placeholder="Password" :class="[formErrors.password ? 'is-invalid' : '']" v-model.trim="formData.password" autocomplete="current-password">
          <div class="invalid-feedback" v-if="formErrors.password"><%=__('Please enter a password')%>.</div>
        </div>
        <div class="form-group form-check">
          <input class="form-check-input" type="checkbox" id="remember" name="rememberMe" v-model="formData.rememberMe"/>
          <label class="form-check-label" for="remember"><%=__('Remember me')%></label>
        </div>
        <cloud-error v-if="cloudError==='badCombo'"><%=__('The credentials you entered are not associated with an account')%>.</cloud-error>
        <cloud-error v-else-if="cloudError"></cloud-error>
        <div class="form-group">
          <ajax-button :syncing="syncing" class="btn-primary btn-lg btn-block"><%=__('Sign in')%></ajax-button>
            <a href="/" class="btn btn-primary btn-lg btn-block"><%=__('Cancel')%></a>
        </div>
      </ajax-form>
      <p class="text-center mt-3"><a href="/password/forgot"><%=__('Forgot your password')%>?</a></p>
    </div>
  </div>
</div>
<%- /* Expose locals as `window.SAILS_LOCALS` :: */ exposeLocalsToBrowser() %>
