From 85cf8be70597f951f8947bc34a21d8088b20095e Mon Sep 17 00:00:00 2001 From: dmitriylaukhin Date: Fri, 12 Jun 2026 14:05:32 +0500 Subject: [PATCH] Explicitly resend verification email on unverified login Better Auth does not auto-resend on 403 (verified against Resend logs), so request a fresh link via authClient.sendVerificationEmail before telling the user a new email was sent. Co-Authored-By: Claude Opus 4.8 --- src/app/(auth)/login/login-form.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/(auth)/login/login-form.tsx b/src/app/(auth)/login/login-form.tsx index ff0afb2..6cee331 100644 --- a/src/app/(auth)/login/login-form.tsx +++ b/src/app/(auth)/login/login-form.tsx @@ -23,8 +23,9 @@ export function LoginForm() { if (result.error) { if (result.error.status === 403) { - // Креды верны, но email не подтверждён. Better Auth уже - // переотправил письмо подтверждения — сообщаем об этом. + // Креды верны, но email не подтверждён. Better Auth сам письмо + // не переотправляет (проверено) — запрашиваем свежую ссылку явно. + await authClient.sendVerificationEmail({ email, callbackURL: "/dashboard" }); setNeedsVerification(true); } else if (result.error.status === 429) { setError("Слишком много попыток входа. Подождите минуту и попробуйте снова.");