53 lines
2.5 KiB
HTML
53 lines
2.5 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html lang="en">
|
||
|
|
<head>
|
||
|
|
<meta charset="UTF-8">
|
||
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
|
<title>Forgot password — rokojori</title>
|
||
|
|
<style>
|
||
|
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||
|
|
body { font-family: system-ui, sans-serif; background: #111; color: #eee; display: flex; align-items: center; justify-content: center; min-height: 100vh; }
|
||
|
|
.card { background: #1c1c1c; border: 1px solid #2a2a2a; border-radius: 8px; padding: 2rem; width: 100%; max-width: 360px; }
|
||
|
|
h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
|
||
|
|
p.subtitle { font-size: 0.85rem; color: #888; margin-bottom: 1.5rem; }
|
||
|
|
label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 0.25rem; }
|
||
|
|
input { display: block; width: 100%; padding: 0.6rem 0.75rem; background: #111; border: 1px solid #333; border-radius: 4px; color: #eee; font-size: 0.95rem; margin-bottom: 1rem; }
|
||
|
|
input:focus { outline: none; border-color: #555; }
|
||
|
|
button { width: 100%; padding: 0.65rem; background: #2563eb; border: none; border-radius: 4px; color: #fff; font-size: 0.95rem; cursor: pointer; }
|
||
|
|
button:hover { background: #1d4ed8; }
|
||
|
|
.links { display: flex; justify-content: center; margin-top: 1.25rem; font-size: 0.8rem; }
|
||
|
|
.links a { color: #888; text-decoration: none; }
|
||
|
|
.links a:hover { color: #ccc; }
|
||
|
|
.success { background: #14532d; border: 1px solid #166534; border-radius: 4px; padding: 0.75rem; font-size: 0.9rem; color: #4ade80; }
|
||
|
|
</style>
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<div class="card">
|
||
|
|
<h1>Forgot password</h1>
|
||
|
|
<p class="subtitle">Enter your email and we'll send a reset link.</p>
|
||
|
|
<div id="sent" class="success" hidden>Check your inbox — a reset link is on its way.</div>
|
||
|
|
<form id="form">
|
||
|
|
<label for="email">Email</label>
|
||
|
|
<input type="email" id="email" name="email" required autocomplete="email">
|
||
|
|
<button type="submit">Send reset link</button>
|
||
|
|
</form>
|
||
|
|
<div class="links">
|
||
|
|
<a href="/login.html">Back to log in</a>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<script>
|
||
|
|
document.getElementById('form').addEventListener('submit', async e => {
|
||
|
|
e.preventDefault();
|
||
|
|
const email = document.getElementById('email').value;
|
||
|
|
await fetch('/api/auth/forgot-password', {
|
||
|
|
method: 'POST',
|
||
|
|
headers: { 'Content-Type': 'application/json' },
|
||
|
|
body: JSON.stringify({ email })
|
||
|
|
});
|
||
|
|
document.getElementById('form').hidden = true;
|
||
|
|
document.getElementById('sent').hidden = false;
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
</body>
|
||
|
|
</html>
|