Joachim Van Herwegen a47f5236ef feat: Full rework of account management
Complete rewrite of the account management and related systems.
Makes the architecture more modular,
allowing for easier extensions and configurations.
2023-10-06 11:04:40 +02:00

50 lines
1.5 KiB
Plaintext

<div id="input-partial">
<h1>Forgot password</h1>
<form method="post" id="mainForm">
<p class="error" id="error"></p>
<fieldset>
<ol>
<li>
<label for="input-email">Email</label>
<input id="input-email" type="email" name="email" autofocus>
</li>
</ol>
</fieldset>
<ul class="actions">
<li><button type="submit" name="submit">Send recovery email</button></li>
<li><button type="button" id="input-login-link">Back</button></li>
</ul>
</form>
</div>
<div id="response-partial">
<h1>Email sent</h1>
<p>If your account exists, an email has been sent with a link to reset your password.</p>
<p>If you do not receive your email in a couple of minutes, check your spam folder or try sending another email.</p>
<ul class="actions">
<li><button type="button" id="response-login-link">Log in</button></li>
<li><button type="button" id="response-forgot-link">Back</button></li>
</ul>
</div>
<script>
setVisibility('response-partial', false);
(async() => {
const controls = await fetchControls('<%= idpIndex %>');
setRedirectClick('input-login-link', controls.html.password.login);
setRedirectClick('response-login-link', controls.html.password.login);
setRedirectClick('response-forgot-link', controls.html.password.forgot);
addPostListener(async() => {
await postJsonForm(controls.password.forgot);
// Swap visibility
setVisibility('input-partial', false);
setVisibility('response-partial', true);
});
})();
</script>