Update app.db, enhance Home component with social proof feature, and improve error handling in auth module
All checks were successful
Deploy / deploy (push) Successful in 22m12s

- Updated app.db to reflect recent changes.
- Added a Suspense-wrapped SosyalKanitBandi component in the Home page for improved user engagement.
- Refactored the sendMagicLinkEmail function in auth.ts to handle errors more effectively, ensuring users receive appropriate feedback on email sending issues.
- Removed the Rybbit live visitor widget from the site footer for a cleaner design.
This commit is contained in:
bilalgursen
2026-08-02 21:10:43 +03:00
parent 0b92f999bc
commit 2278d2a218
9 changed files with 360 additions and 24 deletions

View File

@@ -19,7 +19,7 @@ async function sendMagicLinkEmail(email: string, url: string) {
const { Resend } = await import("resend");
const resend = new Resend(process.env.RESEND_API_KEY);
const { subject, html, text } = magicLinkEpostasi(url);
await resend.emails.send({
const { error } = await resend.emails.send({
from: process.env.EMAIL_FROM ?? "KolayTercih <onboarding@resend.dev>",
to: email,
subject,
@@ -28,6 +28,13 @@ async function sendMagicLinkEmail(email: string, url: string) {
// istemcilerde bağlantının okunabilir kalmasını sağlar.
text,
});
// Resend SDK hata fırlatmaz, { data, error } döndürür. Kontrol etmezsek
// doğrulanmamış domain/kota hatasında kullanıcı "gönderildi" ekranını
// görür ama mail hiç çıkmaz — fırlatarak better-auth'a hata döndürüyoruz.
if (error) {
console.error(`[giris] Magic link gönderilemedi (${email}):`, error);
throw new Error(`Resend: ${error.name}${error.message}`);
}
}
export const auth = betterAuth({