The Open Source DocuSign Alternative.
TypeScript digital-signaturedocument-signingdocusign-alternativee-signatureesignesignaturenext-authnextjsopen-sourcepades-standardpdfpdf-signpdf-signaturepostgresqlprismaself-hostedsigningtypescript
Avoid leaking that a user has an account
Ephraim Atta-Duncan9cfbb1dec977
diff --git a/apps/web/pages/api/auth/forgot-password.ts b/apps/web/pages/api/auth/forgot-password.tsindex 80aefe5a7..07d57dce7 100644--- a/apps/web/pages/api/auth/forgot-password.ts+++ b/apps/web/pages/api/auth/forgot-password.ts@@ -20,7 +20,7 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {});if (!user) {- return res.status(404).json({ message: "No user found with this email" });+ return res.status(200).json({ message: "A password reset email has been sent." });}const existingToken = await prisma.passwordResetToken.findFirst({@@ -33,7 +33,7 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {});if (existingToken) {- return res.status(400).json({ message: "Password reset requested." });+ return res.status(200).json({ message: "A password reset email has been sent." });}const token = crypto.randomBytes(64).toString("hex");@@ -55,7 +55,7 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {await sendResetPassword(user, passwordResetToken.token);- res.status(200).json({ message: "Password reset email sent." });+ return res.status(200).json({ message: "A password reset email has been sent." });}export default defaultHandler({