Scheduling infrastructure for absolutely everyone.
fix: Prevent Timing Attacks by Removing await in Password Reset Flow (#21747)
Sebastian Brunowe781a78eea30
diff --git a/apps/web/app/api/auth/forgot-password/route.ts b/apps/web/app/api/auth/forgot-password/route.tsindex 9e598196f6a..064dfce857e 100644--- a/apps/web/app/api/auth/forgot-password/route.ts+++ b/apps/web/app/api/auth/forgot-password/route.ts@@ -37,8 +37,7 @@ async function handler(req: NextRequest) {select: { name: true, email: true, locale: true },});// Don't leak info about whether the user exists- if (!user) return NextResponse.json({ message: "password_reset_email_sent" }, { status: 201 });- await passwordResetRequest(user);+ if (user) passwordResetRequest(user).catch(console.error);return NextResponse.json({ message: "password_reset_email_sent" }, { status: 201 });} catch (reason) {console.error(reason);