{% extends "base_anon.html" %}

{% block title %}Reset your password{% endblock %}

{% block main %}

<h5 class="card-title float-end">Reset your password</h5>

<div id="result" class="alert alert-danger" style="display: none"></div>

<form action="{{ url('auth/forgot-password') }}" method="post"
      onsubmit="return resetPassword(this)">

    <p>
    Enter your user account's email address and we will send you a password reset link.
    </p>
    <div class="form-floating mb-2">
        <input type="email" name="email" class="form-control" placeholder="" required>
        <label class="form-label">Email address</label>
    </div>
    <button type="submit" class="btn btn-primary">Reset</button>
</form>

<p class="mt-2">
<a href="{{ url('login') }}">Sign in</a>
</p>

<script>
function resetPassword(form) {
    const successURL = '{{ url("forgot-password-ok") }}';
    submitFormAsJSON(form, successURL);
    return false;
}
</script>

{% endblock %}
