AzerothCore-website/templates/resetpassword.html
Aaron Barbas 9bbeb35c08 Added support link to download game client, link for addons.
Fixed an issue that prevented the password reset tokens from working.
Added email templates for password reset success and new account creation.
Added more dynamic email template support.
2024-10-03 22:00:40 -05:00

39 lines
1.3 KiB
HTML

{% extends "base.html" %}
{% block content %}
<div class="container">
<div class="heading">Reset Password</div>
<form id="resetForm" class="form" onsubmit="event.preventDefault(); resetPassword();">
<div class="input-field">
<label for="email">Email Address</label>
<input type="email" id="email" required autocomplete="off" />
</div>
<div class="btn-container">
<button type="submit" class="btn">Reset Password</button>
</div>
</form>
<p id="result" style="color: white;"></p>
</div>
<script>
function resetPassword() {
const email = document.getElementById('email').value;
fetch('/reset_password', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ email: email }),
})
.then(response => response.json())
.then(data => {
const resultElement = document.getElementById('result');
resultElement.innerText = data.message;
resultElement.style.color = data.success ? 'red' : 'white';
})
.catch((error) => {
console.error('Error:', error);
});
}
</script>
{% endblock %}