<%# Page users are routed to when they forget email %>

<%- include("../partials/header") -%>
<%- include("../partials/navigationPublic") -%>

<script>

    $(document).ready(function () {

        $("#password-req").hide();
        $("#newpw").focus(function() {
            $("#password-req").show(100);
        });
        $("#newpw").blur(function() {
            window.setTimeout(function() {
                $("#password-req").hide(100);
            }, 1000);
        });

    });

</script>

<div class="jumbotron container my-5">
    <%- include ("../partials/flashes") -%>
    <h3 class="mb-3">A confirmation code has been sent to <%= locals.forgotPassUser %></h3>

    <form action="/forgotPassword" method="post">
        <input class="form-control my-1" type="text" placeholder="Confirmation Code" name="enteredCode" id="enteredCode" >
        <input class="form-control my-1" type="text" placeholder="" name="username" id="username" type="hidden" value="<%= locals.forgotPassUser %>" readonly>
        <input type="password" class="form-control my-1" id="newpw" name="newpw" placeholder="New Password">
        <input type="password" class="form-control my-1" id="confirmnewpw" name="confirmnewpw" placeholder="Confirm New Password">
        <p class="container mb-4 mt-2" id="password-req">A valid password must have a minimum of <strong>7 characters</strong> which includes at least <strong>1 letter</strong> and at least <strong>1 number</strong></p>

        <input type="submit" class="btn btn-primary mt-3" id="ChangePW" value="Change password">
    </form>
</div>

<%- include("../partials/footer") -%>
