<div id="forgot-password" v-cloak>
  <div class="container-fluid pt-5 pb-5">
    <h1 class="text-center">Recover password</h1>
    <div style="max-width:  450px;" class="mx-auto" v-if="!cloudSuccess">
      <p class="text-center">Enter your email address below to reset the password for your account.</p>
      <hr/>
      <ajax-form action="sendPasswordRecoveryEmail" :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" name="email-address" class="form-control" placeholder="sturgeon@example.com" :class="[formErrors.emailAddress ? 'is-invalid' : '']" v-model.trim="formData.emailAddress" autocomplete="email" focus-first>
          <div class="invalid-feedback" v-if="formErrors.emailAddress">Please enter a valid email address.</div>
        </div>
        <cloud-error v-if="cloudError"></cloud-error>
        <div class="form-group">
          <ajax-button type="submit" :syncing="syncing" class="btn btn-dark btn-lg btn-block">Send reset link</ajax-button>
        </div>
      </ajax-form>
      <p class="text-center"><a href="/login">Back to login</a></p>
    </div>
    <div style="max-width:  450px;" class="mx-auto text-center" v-else>
      <p>We've sent you a link to update your password.</p>
      <hr/>
      <p>If the email doesn’t arrive after a few minutes, try checking your spam folder.  If you still can’t find it, please try again, or <a href="/contact">contact support</a>.</p>
      <p class="text-center"><a class="btn btn-outline-primary" href="/login">Back to login</a></p>
    </div>
  </div>
</div>
<%- /* Expose locals as `window.SAILS_LOCALS` :: */ exposeLocalsToBrowser() %>
