diff --git a/server/authRoutes.ts b/server/authRoutes.ts index 2fb8903..b0cf001 100644 --- a/server/authRoutes.ts +++ b/server/authRoutes.ts @@ -59,8 +59,10 @@ export function registerAuthRoutes(app: Express) { const expiry = new Date(Date.now() + 24 * 60 * 60 * 1000); // 24 hours await updateUserVerification(user.id, token, expiry); - // Send verification email - await sendVerificationEmail(sanitizedEmail, sanitizedName, token); + // Send verification email (fire-and-forget — don't block registration on SMTP failure) + sendVerificationEmail(sanitizedEmail, sanitizedName, token).catch((err) => { + console.error("[Auth] Verification email failed (non-blocking):", err); + }); res.status(201).json({ ok: true, @@ -163,7 +165,10 @@ export function registerAuthRoutes(app: Express) { const token = crypto.randomUUID(); const expiry = new Date(Date.now() + 24 * 60 * 60 * 1000); await updateUserVerification(user.id, token, expiry); - await sendVerificationEmail(user.email, user.name, token); + // Fire-and-forget — don't block response on SMTP failure + sendVerificationEmail(user.email, user.name, token).catch((err) => { + console.error("[Auth] Resend verification email failed (non-blocking):", err); + }); res.json({ ok: true, message: "Verification email sent. Please check your inbox." }); } catch (error) {