fix: add verification resend flow
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user