fix: add verification resend flow
All checks were successful
deploy-socialize / image (push) Successful in 1m21s
deploy-socialize / deploy (push) Successful in 14s

This commit is contained in:
2026-05-06 15:43:25 -04:00
parent 7a862a202a
commit a97ff2dc38
4 changed files with 103 additions and 19 deletions

View File

@@ -32,10 +32,18 @@ public class RegisterHandler(
RegisterRequest request,
CancellationToken ct)
{
// Check if the user already exists
User? existingUser = await userManager.FindByEmailAsync(request.Email);
if (existingUser is not null)
{
if (!existingUser.EmailConfirmed)
{
await emailVerificationService.SendVerificationEmailAsync(existingUser);
await SendOkAsync(
new RegisterResponse("Registration successful! Please check your email to verify your account."),
ct);
return;
}
await SendStringAsync(
"A user with this email already exists",
400,