feat: implement password reset API endpoint and wire up form

- Add POST /api/auth/password-reset endpoint to validate email and process reset requests
- Wire up password reset form to call API instead of stubbing success
- This enables proper password reset flow for Issue #10
This commit is contained in:
2026-05-01 16:47:27 -07:00
parent 2292aa6d7f
commit 88203869d5
2 changed files with 53 additions and 0 deletions
+16
View File
@@ -15,6 +15,22 @@ export default function PasswordResetPage() {
setError("")
try {
const response = await fetch("/api/auth/password-reset", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ email }),
})
const data = await response.json()
if (!response.ok) {
setError(data.error || "Failed to send reset link")
setLoading(false)
return
}
setSent(true)
} catch (err) {
console.error("Password reset error:", err)