{{ define "title" }} {{getText "auth.forgot_pwd"}} {{ end }}
{{ define "content" }}
<h1 class="mb-2">{{getText "auth.forgot_pwd"}}</h1>
<form class="segment-panel" id="pwd_forgot_form">
    <label class="block mb-2">
        <span class="form-label">{{getText "email"}}</span>
		<input class="form-input w-full" type="email" id="pwd_email" name="email" required/>
    </label>
    <button type="submit" class="block btn btn-blue">{{getText "recover"}}</button>
</form>

<script>

document.getElementById("pwd_forgot_form").addEventListener("submit", sendRequest)

async function sendRequest(e) {
    e.preventDefault();
    let email = document.getElementById("pwd_email").value;
    let res = await bundled.postCall("/auth/forgotPassword", {email})
    bundled.apiToast(res)
}

</script>

{{ end }}