Skip to content

Commit fe691a2

Browse files
committed
Revert to privacy-preserving forgot password flow to bypass Firebase protection
1 parent 22f0fb0 commit fe691a2

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

src/app/auth/forgot-password/page.tsx

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

33
import { useState } from "react";
4-
import { resetPassword, checkEmailExists } from "@/lib/firebase/auth";
4+
import { resetPassword } from "@/lib/firebase/auth";
55
import Link from "next/link";
66
import { Mail, ArrowLeft } from "lucide-react";
77
import { useToast } from "@/context/ToastContext";
@@ -24,19 +24,14 @@ export default function ForgotPasswordPage() {
2424
}
2525

2626
try {
27-
// Check if email exists in Firebase Auth
28-
const emailExists = await checkEmailExists(email);
29-
30-
if (!emailExists) {
31-
addToast("We couldn't find an account with this email address.", "error");
32-
setLoading(false);
33-
return;
34-
}
35-
36-
// Email exists - send password reset link
27+
// Standard Security Practice:
28+
// We blindly send the reset request. Firebase handles existence checks internally.
29+
// If the user exists, they get an email. If not, nothing happens.
30+
// We always show success to prevent email enumeration attacks and ensure valid users aren't blocked by API protections.
3731
await resetPassword(email);
38-
addToast("Password reset link has been sent to your email.", "success");
39-
setEmail(""); // Clear the email field
32+
33+
addToast("If an account exists with this email, a password reset link has been sent.", "success");
34+
setEmail(""); // Clear form
4035
} catch (err: any) {
4136
console.error("Error in handleReset:", err);
4237
addToast("Something went wrong. Please try again later.", "error");

0 commit comments

Comments
 (0)